<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="discoveryengine_v1alpha.html">Discovery Engine API</a> . <a href="discoveryengine_v1alpha.projects.html">projects</a> . <a href="discoveryengine_v1alpha.projects.locations.html">locations</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.html">collections</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.dataStores.html">dataStores</a> . <a href="discoveryengine_v1alpha.projects.locations.collections.dataStores.servingConfigs.html">servingConfigs</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#answer">answer(servingConfig, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Answer query method.</p>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.</p>
<p class="toc_element">
  <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists all ServingConfigs linked to this dataStore.</p>
<p class="toc_element">
  <code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#patch">patch(name, body=None, updateMask=None, x__xgafv=None)</a></code></p>
<p class="firstline">Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.</p>
<p class="toc_element">
  <code><a href="#recommend">recommend(servingConfig, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Makes a recommendation, which requires a contextual user event.</p>
<p class="toc_element">
  <code><a href="#search">search(servingConfig, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Performs a search.</p>
<p class="toc_element">
  <code><a href="#searchLite">searchLite(servingConfig, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Performs a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required. Only public website search is supported by this method. If data stores and engines not associated with public website search are specified, a `FAILED_PRECONDITION` error is returned. This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.</p>
<p class="toc_element">
  <code><a href="#searchLite_next">searchLite_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#search_next">search_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#streamAnswer">streamAnswer(servingConfig, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Answer query method (streaming). It takes one AnswerQueryRequest and returns multiple AnswerQueryResponse messages in a stream.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="answer">answer(servingConfig, body=None, x__xgafv=None)</code>
  <pre>Answer query method.

Args:
  servingConfig: string, Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ConversationalSearchService.AnswerQuery method.
  &quot;answerGenerationSpec&quot;: { # Answer generation specification. # Answer generation specification.
    &quot;answerLanguageCode&quot;: &quot;A String&quot;, # Language code for Answer. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
    &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating answers for adversarial queries and return fallback messages instead.
    &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
    &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true` or unset, the behavior will be determined automatically by the service.
    &quot;ignoreNonAnswerSeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not answer-seeking. The default value is `false`. Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to `true`, we skip generating answers for non-answer seeking queries and return fallback messages instead.
    &quot;includeCitations&quot;: True or False, # Specifies whether to include citation metadata in the answer. The default value is `false`.
    &quot;modelSpec&quot;: { # Answer Generation Model specification. # Answer generation model specification.
      &quot;modelVersion&quot;: &quot;A String&quot;, # Model version. If not set, it will use the default stable model. Allowed values are: stable, preview.
    },
    &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
      &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
    },
    &quot;promptSpec&quot;: { # Answer generation prompt specification. # Answer generation prompt specification.
      &quot;preamble&quot;: &quot;A String&quot;, # Customized preamble.
    },
  },
  &quot;asynchronousMode&quot;: True or False, # Deprecated: This field is deprecated. Streaming Answer API will be supported. Asynchronous mode control. If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.
  &quot;endUserSpec&quot;: { # End user specification. # Optional. End user specification.
    &quot;endUserMetadata&quot;: [ # Optional. End user metadata.
      { # End user metadata.
        &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
          &quot;content&quot;: &quot;A String&quot;, # Chunk textual content. It is limited to 8000 characters.
          &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
            &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          },
        },
      },
    ],
  },
  &quot;groundingSpec&quot;: { # Grounding specification. # Optional. Grounding specification.
    &quot;filteringLevel&quot;: &quot;A String&quot;, # Optional. Specifies whether to enable the filtering based on grounding score and at what level.
    &quot;includeGroundingSupports&quot;: True or False, # Optional. Specifies whether to include grounding_supports in the answer. The default value is `false`. When this field is set to `true`, returned answer will have `grounding_score` and will contain GroundingSupports for each claim.
  },
  &quot;query&quot;: { # Defines a user inputed query. # Required. Current user query.
    &quot;queryId&quot;: &quot;A String&quot;, # Output only. Unique Id for the query.
    &quot;text&quot;: &quot;A String&quot;, # Plain text.
  },
  &quot;queryUnderstandingSpec&quot;: { # Query understanding specification. # Query understanding specification.
    &quot;disableSpellCorrection&quot;: True or False, # Optional. Whether to disable spell correction. The default value is `false`.
    &quot;queryClassificationSpec&quot;: { # Query classification specification. # Query classification specification.
      &quot;types&quot;: [ # Enabled query classification types.
        &quot;A String&quot;,
      ],
    },
    &quot;queryRephraserSpec&quot;: { # Query rephraser specification. # Query rephraser specification.
      &quot;disable&quot;: True or False, # Disable query rephraser.
      &quot;maxRephraseSteps&quot;: 42, # Max rephrase steps. The max number is 5 steps. If not set or set to &lt; 1, it will be set to 1 by default.
      &quot;modelSpec&quot;: { # Query Rephraser Model specification. # Optional. Query Rephraser Model specification.
        &quot;modelType&quot;: &quot;A String&quot;, # Optional. Enabled query rephraser model type. If not set, it will use LARGE by default.
      },
    },
  },
  &quot;relatedQuestionsSpec&quot;: { # Related questions specification. # Related questions specification.
    &quot;enable&quot;: True or False, # Enable related questions feature if true.
  },
  &quot;safetySpec&quot;: { # Safety specification. There are two use cases: 1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories. 2. when safety_spec.enable is set and some safety_settings are set, only specified safety_settings are applied. # Model specification.
    &quot;enable&quot;: True or False, # Enable the safety filtering on the answer response. It is false by default.
    &quot;safetySettings&quot;: [ # Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.
      { # Safety settings.
        &quot;category&quot;: &quot;A String&quot;, # Required. Harm category.
        &quot;threshold&quot;: &quot;A String&quot;, # Required. The harm block threshold.
      },
    ],
  },
  &quot;searchSpec&quot;: { # Search specification. # Search specification.
    &quot;searchParams&quot;: { # Search parameters. # Search parameters.
      &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Boost specification to boost certain documents in search results which may affect the answer query response. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
        &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
          { # Boost applies to documents which match a condition.
            &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
            &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
              &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
              &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                  &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                  &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                },
              ],
              &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
              &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
            },
            &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
          },
        ],
      },
      &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs.
        &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
      },
      &quot;dataStoreSpecs&quot;: [ # Specs defining dataStores to filter on in a search call and configurations for those dataStores. This is only considered for engines with multiple dataStores use case. For single dataStore within an engine, they should use the specs at the top level.
        { # A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error is returned.
          &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Optional. Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
            &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
              { # Boost applies to documents which match a condition.
                &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
                &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
                  &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
                  &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                    { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                      &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                      &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                    },
                  ],
                  &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
                  &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
                },
                &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
              },
            ],
          },
          &quot;customSearchOperators&quot;: &quot;A String&quot;, # Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
          &quot;dataStore&quot;: &quot;A String&quot;, # Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. The path must include the project number, project id is not supported for this field.
          &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
        },
      ],
      &quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the Answer response. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customers might have a field &#x27;name&#x27; in their schema. In this case the filter would look like this: filter --&gt; name:&#x27;ANY(&quot;king kong&quot;)&#x27; For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
      &quot;maxReturnResults&quot;: 42, # Number of search results to return. The default value is 10.
      &quot;naturalLanguageQueryUnderstandingSpec&quot;: { # Specification to enable natural language understanding capabilities for search requests. # Optional. Specification to enable natural language understanding capabilities for search requests.
        &quot;allowedFieldNames&quot;: [ # Optional. Allowlist of fields that can be used for natural language filter extraction. By default, if this is unspecified, all indexable fields are eligible for natural language filter extraction (but are not guaranteed to be used). If any fields are specified in allowed_field_names, only the fields that are both marked as indexable in the schema and specified in the allowlist will be eligible for natural language filter extraction. Note: for multi-datastore search, this is not yet supported, and will be ignored.
          &quot;A String&quot;,
        ],
        &quot;extractedFilterBehavior&quot;: &quot;A String&quot;, # Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is `HARD_FILTER`. For multi-datastore search, the default behavior is `SOFT_BOOST`. Location-based filters are always applied as hard filters, and the `SOFT_BOOST` setting will not affect them. This field is only used if SearchRequest.natural_language_query_understanding_spec.filter_extraction_condition is set to FilterExtractionCondition.ENABLED.
        &quot;filterExtractionCondition&quot;: &quot;A String&quot;, # The condition under which filter extraction should occur. Server behavior defaults to `DISABLED`.
        &quot;geoSearchQueryDetectionFieldNames&quot;: [ # Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to `ENABLED`. If this field is set, it overrides the field names set in ServingConfig.geo_search_query_detection_field_names.
          &quot;A String&quot;,
        ],
      },
      &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. For more information on ordering, see [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
      &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`. See [parse and chunk documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    },
    &quot;searchResultList&quot;: { # Search result list. # Search result list.
      &quot;searchResults&quot;: [ # Search results.
        { # Search result.
          &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
            &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
            &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
            &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
              &quot;title&quot;: &quot;A String&quot;, # Title of the document.
              &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
            },
          },
          &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
            &quot;document&quot;: &quot;A String&quot;, # Document resource name.
            &quot;documentContexts&quot;: [ # List of document contexts. The content will be used for Answer Generation. This is supposed to be the main content of the document that can be long and comprehensive.
              { # Document context.
                &quot;content&quot;: &quot;A String&quot;, # Document content to be used for answer generation.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;extractiveAnswers&quot;: [ # Deprecated: This field is deprecated and will have no effect on the Answer generation. Please use document_contexts and extractive_segments fields. List of extractive answers.
              { # Extractive answer. [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
                &quot;content&quot;: &quot;A String&quot;, # Extractive answer content.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;extractiveSegments&quot;: [ # List of extractive segments.
              { # Extractive segment. [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) Answer generation will only use it if document_contexts is empty. This is supposed to be shorter snippets.
                &quot;content&quot;: &quot;A String&quot;, # Extractive segment content.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;title&quot;: &quot;A String&quot;, # Title.
            &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
          },
        },
      ],
    },
  },
  &quot;session&quot;: &quot;A String&quot;, # The session resource name. Not required. When session field is not set, the API is in sessionless mode. We support auto session mode: users can use the wildcard symbol `-` as session ID. A new ID will be automatically generated and assigned.
  &quot;userLabels&quot;: { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;userPseudoId&quot;: &quot;A String&quot;, # A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ConversationalSearchService.AnswerQuery method.
  &quot;answer&quot;: { # Defines an answer. # Answer resource object. If AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps is greater than 1, use Answer.name to fetch answer information using ConversationalSearchService.GetAnswer API.
    &quot;answerSkippedReasons&quot;: [ # Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
      &quot;A String&quot;,
    ],
    &quot;answerText&quot;: &quot;A String&quot;, # The textual answer.
    &quot;blobAttachments&quot;: [ # List of blob attachments in the answer.
      { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
        &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
        &quot;data&quot;: { # The media type and data of the blob. # Output only. The mime type and data of the blob.
          &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
          &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated or retrieved data.
        },
      },
    ],
    &quot;citations&quot;: [ # Citations.
      { # Citation info for a segment.
        &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive. Measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
        &quot;sources&quot;: [ # Citation sources for the attributed segment.
          { # Citation source.
            &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
          },
        ],
        &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
      },
    ],
    &quot;completeTime&quot;: &quot;A String&quot;, # Output only. Answer completed timestamp.
    &quot;createTime&quot;: &quot;A String&quot;, # Output only. Answer creation timestamp.
    &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
    &quot;groundingSupports&quot;: [ # Optional. Grounding supports.
      { # Grounding support for a claim in `answer_text`.
        &quot;endIndex&quot;: &quot;A String&quot;, # Required. End of the claim, exclusive.
        &quot;groundingCheckRequired&quot;: True or False, # Indicates that this claim required grounding check. When the system decided this claim didn&#x27;t require attribution/grounding check, this field is set to false. In that case, no grounding check was done for the claim and therefore `grounding_score`, `sources` is not returned.
        &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks.
        &quot;sources&quot;: [ # Optional. Citation sources for the claim.
          { # Citation source.
            &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
          },
        ],
        &quot;startIndex&quot;: &quot;A String&quot;, # Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode).
      },
    ],
    &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*`
    &quot;queryUnderstandingInfo&quot;: { # Query understanding information. # Query understanding information.
      &quot;queryClassificationInfo&quot;: [ # Query classification information.
        { # Query classification information.
          &quot;positive&quot;: True or False, # Classification output.
          &quot;type&quot;: &quot;A String&quot;, # Query classification type.
        },
      ],
    },
    &quot;references&quot;: [ # References.
      { # Reference.
        &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
          &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
            &quot;A String&quot;,
          ],
          &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
          &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
          &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
            &quot;document&quot;: &quot;A String&quot;, # Document resource name.
            &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
            &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;title&quot;: &quot;A String&quot;, # Title.
            &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
          },
          &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
        },
        &quot;structuredDocumentInfo&quot;: { # Structured search information. # Structured document information.
          &quot;document&quot;: &quot;A String&quot;, # Document resource name.
          &quot;structData&quot;: { # Structured search data.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the document.
        },
        &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
          &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
            { # Chunk content.
              &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                &quot;A String&quot;,
              ],
              &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
              &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
            },
          ],
          &quot;document&quot;: &quot;A String&quot;, # Document resource name.
          &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Title.
          &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
        },
      },
    ],
    &quot;relatedQuestions&quot;: [ # Suggested related questions.
      &quot;A String&quot;,
    ],
    &quot;safetyRatings&quot;: [ # Optional. Safety ratings.
      { # Safety rating corresponding to the generated content.
        &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was filtered out because of this rating.
        &quot;category&quot;: &quot;A String&quot;, # Output only. Harm category.
        &quot;probability&quot;: &quot;A String&quot;, # Output only. Harm probability levels in the content.
        &quot;probabilityScore&quot;: 3.14, # Output only. Harm probability score.
        &quot;severity&quot;: &quot;A String&quot;, # Output only. Harm severity levels in the content.
        &quot;severityScore&quot;: 3.14, # Output only. Harm severity score.
      },
    ],
    &quot;state&quot;: &quot;A String&quot;, # The state of the answer generation.
    &quot;steps&quot;: [ # Answer generation steps.
      { # Step information.
        &quot;actions&quot;: [ # Actions.
          { # Action.
            &quot;observation&quot;: { # Observation. # Observation.
              &quot;searchResults&quot;: [ # Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user.
                {
                  &quot;chunkInfo&quot;: [ # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.
                    { # Chunk information.
                      &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                      &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                      &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                    },
                  ],
                  &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                  &quot;snippetInfo&quot;: [ # If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.
                    { # Snippet information.
                      &quot;snippet&quot;: &quot;A String&quot;, # Snippet content.
                      &quot;snippetStatus&quot;: &quot;A String&quot;, # Status of the snippet defined by the search team.
                    },
                  ],
                  &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It&#x27;s populated from the struct data from the Document, or the Chunk in search result.
                    &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                  },
                  &quot;title&quot;: &quot;A String&quot;, # Title.
                  &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                },
              ],
            },
            &quot;searchAction&quot;: { # Search action. # Search action.
              &quot;query&quot;: &quot;A String&quot;, # The query to search.
            },
          },
        ],
        &quot;description&quot;: &quot;A String&quot;, # The description of the step.
        &quot;state&quot;: &quot;A String&quot;, # The state of the step.
        &quot;thought&quot;: &quot;A String&quot;, # The thought of the step.
      },
    ],
  },
  &quot;answerQueryToken&quot;: &quot;A String&quot;, # A global unique ID used for logging.
  &quot;session&quot;: { # External session proto definition. # Session resource object. It will be only available when session field is set and valid in the AnswerQueryRequest request.
    &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session.
    &quot;endTime&quot;: &quot;A String&quot;, # Output only. The time the session finished.
    &quot;isPinned&quot;: True or False, # Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list.
    &quot;labels&quot;: [ # Optional. The labels for the session. Can be set as filter in ListSessionsRequest.
      &quot;A String&quot;,
    ],
    &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*`
    &quot;startTime&quot;: &quot;A String&quot;, # Output only. The time the session started.
    &quot;state&quot;: &quot;A String&quot;, # The state of the session.
    &quot;turns&quot;: [ # Turns.
      { # Represents a turn, including a query from the user and a answer from service.
        &quot;answer&quot;: &quot;A String&quot;, # Optional. The resource name of the answer to the user query. Only set if the answer generation (/answer API call) happened in this turn.
        &quot;detailedAnswer&quot;: { # Defines an answer. # Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting answer query session.
          &quot;answerSkippedReasons&quot;: [ # Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
            &quot;A String&quot;,
          ],
          &quot;answerText&quot;: &quot;A String&quot;, # The textual answer.
          &quot;blobAttachments&quot;: [ # List of blob attachments in the answer.
            { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
              &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
              &quot;data&quot;: { # The media type and data of the blob. # Output only. The mime type and data of the blob.
                &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
                &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated or retrieved data.
              },
            },
          ],
          &quot;citations&quot;: [ # Citations.
            { # Citation info for a segment.
              &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive. Measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
              &quot;sources&quot;: [ # Citation sources for the attributed segment.
                { # Citation source.
                  &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
                },
              ],
              &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
            },
          ],
          &quot;completeTime&quot;: &quot;A String&quot;, # Output only. Answer completed timestamp.
          &quot;createTime&quot;: &quot;A String&quot;, # Output only. Answer creation timestamp.
          &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
          &quot;groundingSupports&quot;: [ # Optional. Grounding supports.
            { # Grounding support for a claim in `answer_text`.
              &quot;endIndex&quot;: &quot;A String&quot;, # Required. End of the claim, exclusive.
              &quot;groundingCheckRequired&quot;: True or False, # Indicates that this claim required grounding check. When the system decided this claim didn&#x27;t require attribution/grounding check, this field is set to false. In that case, no grounding check was done for the claim and therefore `grounding_score`, `sources` is not returned.
              &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks.
              &quot;sources&quot;: [ # Optional. Citation sources for the claim.
                { # Citation source.
                  &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
                },
              ],
              &quot;startIndex&quot;: &quot;A String&quot;, # Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode).
            },
          ],
          &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*`
          &quot;queryUnderstandingInfo&quot;: { # Query understanding information. # Query understanding information.
            &quot;queryClassificationInfo&quot;: [ # Query classification information.
              { # Query classification information.
                &quot;positive&quot;: True or False, # Classification output.
                &quot;type&quot;: &quot;A String&quot;, # Query classification type.
              },
            ],
          },
          &quot;references&quot;: [ # References.
            { # Reference.
              &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
                &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                  &quot;A String&quot;,
                ],
                &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
                  &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                  &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                  &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
                    &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                  },
                  &quot;title&quot;: &quot;A String&quot;, # Title.
                  &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                },
                &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
              },
              &quot;structuredDocumentInfo&quot;: { # Structured search information. # Structured document information.
                &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                &quot;structData&quot;: { # Structured search data.
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                },
                &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the document.
                &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the document.
              },
              &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
                &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
                  { # Chunk content.
                    &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                      &quot;A String&quot;,
                    ],
                    &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                    &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                    &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                  },
                ],
                &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                },
                &quot;title&quot;: &quot;A String&quot;, # Title.
                &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
              },
            },
          ],
          &quot;relatedQuestions&quot;: [ # Suggested related questions.
            &quot;A String&quot;,
          ],
          &quot;safetyRatings&quot;: [ # Optional. Safety ratings.
            { # Safety rating corresponding to the generated content.
              &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was filtered out because of this rating.
              &quot;category&quot;: &quot;A String&quot;, # Output only. Harm category.
              &quot;probability&quot;: &quot;A String&quot;, # Output only. Harm probability levels in the content.
              &quot;probabilityScore&quot;: 3.14, # Output only. Harm probability score.
              &quot;severity&quot;: &quot;A String&quot;, # Output only. Harm severity levels in the content.
              &quot;severityScore&quot;: 3.14, # Output only. Harm severity score.
            },
          ],
          &quot;state&quot;: &quot;A String&quot;, # The state of the answer generation.
          &quot;steps&quot;: [ # Answer generation steps.
            { # Step information.
              &quot;actions&quot;: [ # Actions.
                { # Action.
                  &quot;observation&quot;: { # Observation. # Observation.
                    &quot;searchResults&quot;: [ # Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user.
                      {
                        &quot;chunkInfo&quot;: [ # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.
                          { # Chunk information.
                            &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                            &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                            &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                          },
                        ],
                        &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                        &quot;snippetInfo&quot;: [ # If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.
                          { # Snippet information.
                            &quot;snippet&quot;: &quot;A String&quot;, # Snippet content.
                            &quot;snippetStatus&quot;: &quot;A String&quot;, # Status of the snippet defined by the search team.
                          },
                        ],
                        &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It&#x27;s populated from the struct data from the Document, or the Chunk in search result.
                          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                        },
                        &quot;title&quot;: &quot;A String&quot;, # Title.
                        &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                      },
                    ],
                  },
                  &quot;searchAction&quot;: { # Search action. # Search action.
                    &quot;query&quot;: &quot;A String&quot;, # The query to search.
                  },
                },
              ],
              &quot;description&quot;: &quot;A String&quot;, # The description of the step.
              &quot;state&quot;: &quot;A String&quot;, # The state of the step.
              &quot;thought&quot;: &quot;A String&quot;, # The thought of the step.
            },
          ],
        },
        &quot;detailedAssistAnswer&quot;: { # AssistAnswer resource, main part of AssistResponse. # Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting assistant session.
          &quot;assistSkippedReasons&quot;: [ # Reasons for not answering the assist call.
            &quot;A String&quot;,
          ],
          &quot;customerPolicyEnforcementResult&quot;: { # Customer policy enforcement results. Contains the results of the various policy checks, like the banned phrases or the Model Armor checks. # Optional. The field contains information about the various policy checks&#x27; results like the banned phrases or the Model Armor checks. This field is populated only if the assist call was skipped due to a policy violation.
            &quot;policyResults&quot;: [ # Customer policy enforcement results. Populated only if the assist call was skipped due to a policy violation. It contains results from those filters that blocked the processing of the query.
              { # Customer policy enforcement result for a single policy type.
                &quot;bannedPhraseEnforcementResult&quot;: { # Customer policy enforcement result for the banned phrase policy. # The policy enforcement result for the banned phrase policy.
                  &quot;bannedPhrases&quot;: [ # The banned phrases that were found in the query or the answer.
                    &quot;A String&quot;,
                  ],
                },
                &quot;modelArmorEnforcementResult&quot;: { # Customer policy enforcement result for the Model Armor policy. # The policy enforcement result for the Model Armor policy.
                  &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error returned by Model Armor if the policy enforcement failed for some reason.
                    &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
                    &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                      {
                        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                      },
                    ],
                    &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
                  },
                  &quot;modelArmorViolation&quot;: &quot;A String&quot;, # The Model Armor violation that was found.
                },
              },
            ],
            &quot;verdict&quot;: &quot;A String&quot;, # Final verdict of the customer policy enforcement. If only one policy blocked the processing, the verdict is BLOCK.
          },
          &quot;name&quot;: &quot;A String&quot;, # Immutable. Identifier. Resource name of the `AssistAnswer`. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` This field must be a UTF-8 encoded string with a length limit of 1024 characters.
          &quot;replies&quot;: [ # Replies of the assistant.
            { # One part of the multi-part response of the assist call.
              &quot;groundedContent&quot;: { # A piece of content and possibly its grounding information. Not all content needs grounding. Phrases like &quot;Of course, I will gladly search it for you.&quot; do not need grounding. # Possibly grounded response text or media from the assistant.
                &quot;citationMetadata&quot;: { # A collection of source attributions for a piece of content. # Source attribution of the generated content. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#citation_check
                  &quot;citations&quot;: [ # Output only. List of citations.
                    { # Source attributions for content.
                      &quot;endIndex&quot;: 42, # Output only. End index into the content.
                      &quot;license&quot;: &quot;A String&quot;, # Output only. License of the attribution.
                      &quot;publicationDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. Publication date of the attribution.
                        &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
                        &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
                        &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
                      },
                      &quot;startIndex&quot;: 42, # Output only. Start index into the content.
                      &quot;title&quot;: &quot;A String&quot;, # Output only. Title of the attribution.
                      &quot;uri&quot;: &quot;A String&quot;, # Output only. Url reference of the attribution.
                    },
                  ],
                },
                &quot;content&quot;: { # Multi-modal content. # The content.
                  &quot;codeExecutionResult&quot;: { # Result of executing ExecutableCode. # Result of executing an ExecutableCode.
                    &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
                    &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
                  },
                  &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed by the model. # Code generated by the model that is meant to be executed.
                    &quot;code&quot;: &quot;A String&quot;, # Required. The code content. Currently only supports Python.
                  },
                  &quot;file&quot;: { # A file, e.g., an audio summary. # A file, e.g., an audio summary.
                    &quot;fileId&quot;: &quot;A String&quot;, # Required. The file ID.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The media type (MIME type) of the file.
                  },
                  &quot;inlineData&quot;: { # Inline blob. # Inline binary data.
                    &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The media type (MIME type) of the generated data.
                  },
                  &quot;role&quot;: &quot;A String&quot;, # The producer of the content. Can be &quot;model&quot; or &quot;user&quot;.
                  &quot;text&quot;: &quot;A String&quot;, # Inline text.
                  &quot;thought&quot;: True or False, # Optional. Indicates if the part is thought from the model.
                },
                &quot;textGroundingMetadata&quot;: { # Grounding details for text sources. # Metadata for grounding based on text sources.
                  &quot;references&quot;: [ # References for the grounded text.
                    { # Referenced content and related document metadata.
                      &quot;content&quot;: &quot;A String&quot;, # Referenced text content.
                      &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
                        &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                        &quot;domain&quot;: &quot;A String&quot;, # Domain name from the document URI. Note that the `uri` field may contain a URL that redirects to the actual website, in which case this will contain the domain name of the target site.
                        &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
                        &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                        &quot;title&quot;: &quot;A String&quot;, # Title.
                        &quot;uri&quot;: &quot;A String&quot;, # URI for the document. It may contain a URL that redirects to the actual website.
                      },
                    },
                  ],
                  &quot;segments&quot;: [ # Grounding information for parts of the text.
                    { # Grounding information for a segment of the text.
                      &quot;endIndex&quot;: &quot;A String&quot;, # End of the segment, exclusive.
                      &quot;groundingScore&quot;: 3.14, # Score for the segment.
                      &quot;referenceIndices&quot;: [ # References for the segment.
                        42,
                      ],
                      &quot;startIndex&quot;: &quot;A String&quot;, # Zero-based index indicating the start of the segment, measured in bytes of a UTF-8 string (i.e. characters encoded on multiple bytes have a length of more than one).
                      &quot;text&quot;: &quot;A String&quot;, # The text segment itself.
                    },
                  ],
                },
              },
              &quot;replyId&quot;: &quot;A String&quot;, # Output only. When set, uniquely identifies a reply within the `AssistAnswer` resource. During an AssistantService.StreamAssist call, multiple `Reply` messages with the same ID can occur within the response stream (across multiple AssistantService.StreamAssistResponse messages). These represent parts of a single `Reply` message in the final `AssistAnswer` resource.
            },
          ],
          &quot;state&quot;: &quot;A String&quot;, # State of the answer generation.
        },
        &quot;query&quot;: { # Defines a user inputed query. # Optional. The user query. May not be set if this turn is merely regenerating an answer to a different turn
          &quot;queryId&quot;: &quot;A String&quot;, # Output only. Unique Id for the query.
          &quot;text&quot;: &quot;A String&quot;, # Plain text.
        },
        &quot;queryConfig&quot;: { # Optional. Represents metadata related to the query config, for example LLM model and version used, model parameters (temperature, grounding parameters, etc.). The prefix &quot;google.&quot; is reserved for Google-developed functionality.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
      },
    ],
    &quot;userPseudoId&quot;: &quot;A String&quot;, # A unique identifier for tracking users.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="get">get(name, x__xgafv=None)</code>
  <pre>Gets a ServingConfig. Returns a NotFound error if the ServingConfig does not exist.

Args:
  name: string, Required. The resource name of the ServingConfig to get. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config_id}` (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and generates results.
  &quot;answerGenerationSpec&quot;: { # The specification for answer generation. # Optional. The specification for answer generation.
    &quot;userDefinedClassifierSpec&quot;: { # The specification for user defined classifier. # Optional. The specification for user specified classifier spec.
      &quot;enableUserDefinedClassifier&quot;: True or False, # Optional. Whether or not to enable and include user defined classifier.
      &quot;modelId&quot;: &quot;A String&quot;, # Optional. The model id to be used for the user defined classifier.
      &quot;preamble&quot;: &quot;A String&quot;, # Optional. The preamble to be used for the user defined classifier.
      &quot;seed&quot;: 42, # Optional. The seed value to be used for the user defined classifier.
      &quot;taskMarker&quot;: &quot;A String&quot;, # Optional. The task marker to be used for the user defined classifier.
      &quot;temperature&quot;: 3.14, # Optional. The temperature value to be used for the user defined classifier.
      &quot;topK&quot;: &quot;A String&quot;, # Optional. The top-k value to be used for the user defined classifier.
      &quot;topP&quot;: 3.14, # Optional. The top-p value to be used for the user defined classifier.
    },
  },
  &quot;boostControlIds&quot;: [ # Boost controls to use in serving path. All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.
    &quot;A String&quot;,
  ],
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. ServingConfig created timestamp.
  &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If SearchRequest.custom_fine_tuning_spec is set, it has higher priority than the configs set here.
    &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
  },
  &quot;displayName&quot;: &quot;A String&quot;, # Required. The human readable serving config display name. Used in Discovery UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
  &quot;dissociateControlIds&quot;: [ # Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;diversityLevel&quot;: &quot;A String&quot;, # How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;embeddingConfig&quot;: { # Defines embedding config, used for bring your own embeddings feature. # Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.
    &quot;fieldPath&quot;: &quot;A String&quot;, # Full field path in the schema mapped as embedding field.
  },
  &quot;filterControlIds&quot;: [ # Filter controls to use in serving path. All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.
    &quot;A String&quot;,
  ],
  &quot;genericConfig&quot;: { # Specifies the configurations needed for Generic Discovery.Currently we support: * `content_search_spec`: configuration for generic content search. # The GenericConfig of the serving configuration.
    &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # Specifies the expected behavior of content search. Only valid for content-search enabled data store.
      &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
        &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
        &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
      },
      &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
        &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
        &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
        &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
        &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
        &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
      },
      &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
      &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
        &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
        &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
        &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
      },
      &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
        &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
        &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
        &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
        &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
        &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
        &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
        &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
          &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
        },
        &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
          &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
        },
        &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
          &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
        },
        &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
        &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
      },
    },
  },
  &quot;guidedSearchSpec&quot;: { # Defines guided search spec. # Guided search configs.
    &quot;enableRefinementAttributes&quot;: True or False, # Whether or not to enable and include refinement attributes in gudied search result.
    &quot;enableRelatedQuestions&quot;: True or False, # Whether or not to enable and include related questions in search response.
    &quot;maxRelatedQuestions&quot;: 42, # Max number of related questions to be returned. The valid range is [1, 5]. If enable_related_questions is true, the default value is 3.
  },
  &quot;ignoreControlIds&quot;: [ # Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. Order does not matter. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;mediaConfig&quot;: { # Specifies the configurations needed for Media Discovery. Currently we support: * `demote_content_watched`: Threshold for watched content demotion. Customers can specify if using watched content demotion or use viewed detail page. Using the content watched demotion, customers need to specify the watched minutes or percentage exceeds the threshold, the content will be demoted in the recommendation result. * `promote_fresh_content`: cutoff days for fresh content promotion. Customers can specify if using content freshness promotion. If the content was published within the cutoff days, the content will be promoted in the recommendation result. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION. # The MediaConfig of the serving configuration.
    &quot;contentFreshnessCutoffDays&quot;: 42, # Specifies the content freshness used for recommendation result. Contents will be demoted if contents were published for more than content freshness cutoff days.
    &quot;contentWatchedPercentageThreshold&quot;: 3.14, # Specifies the content watched percentage threshold for demotion. Threshold value must be between [0, 1.0] inclusive.
    &quot;contentWatchedSecondsThreshold&quot;: 3.14, # Specifies the content watched minutes threshold for demotion.
    &quot;demoteContentWatchedPastDays&quot;: 42, # Optional. Specifies the number of days to look back for demoting watched content. If set to zero or unset, defaults to the maximum of 365 days.
    &quot;demotionEventType&quot;: &quot;A String&quot;, # Specifies the event type used for demoting recommendation result. Currently supported values: * `view-item`: Item viewed. * `media-play`: Start/resume watching a video, playing a song, etc. * `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.
  },
  &quot;modelId&quot;: &quot;A String&quot;, # The id of the model to use at serving time. Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`
  &quot;onewaySynonymsControlIds&quot;: [ # Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization spec. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
    &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
  },
  &quot;promoteControlIds&quot;: [ # Condition promote specifications. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;rankingExpression&quot;: &quot;A String&quot;, # The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if `SearchRequest.ranking_expression` is specified, it overrides the ServingConfig ranking expression. The ranking expression is a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
  &quot;redirectControlIds&quot;: [ # IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;replacementControlIds&quot;: [ # Condition replacement specifications. Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;solutionType&quot;: &quot;A String&quot;, # Required. Immutable. Specifies the solution type that a serving config can be associated with.
  &quot;synonymsControlIds&quot;: [ # Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. ServingConfig updated timestamp.
}</pre>
</div>

<div class="method">
    <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code>
  <pre>Lists all ServingConfigs linked to this dataStore.

Args:
  parent: string, Required. Full resource name of the parent resource. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}` (required)
  pageSize: integer, Optional. Maximum number of results to return. If unspecified, defaults to 100. If a value greater than 100 is provided, at most 100 results are returned.
  pageToken: string, Optional. A page token, received from a previous `ListServingConfigs` call. Provide this to retrieve the subsequent page.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response for ListServingConfigs method.
  &quot;nextPageToken&quot;: &quot;A String&quot;, # Pagination token, if not returned indicates the last page.
  &quot;servingConfigs&quot;: [ # All the ServingConfigs for a given dataStore.
    { # Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and generates results.
      &quot;answerGenerationSpec&quot;: { # The specification for answer generation. # Optional. The specification for answer generation.
        &quot;userDefinedClassifierSpec&quot;: { # The specification for user defined classifier. # Optional. The specification for user specified classifier spec.
          &quot;enableUserDefinedClassifier&quot;: True or False, # Optional. Whether or not to enable and include user defined classifier.
          &quot;modelId&quot;: &quot;A String&quot;, # Optional. The model id to be used for the user defined classifier.
          &quot;preamble&quot;: &quot;A String&quot;, # Optional. The preamble to be used for the user defined classifier.
          &quot;seed&quot;: 42, # Optional. The seed value to be used for the user defined classifier.
          &quot;taskMarker&quot;: &quot;A String&quot;, # Optional. The task marker to be used for the user defined classifier.
          &quot;temperature&quot;: 3.14, # Optional. The temperature value to be used for the user defined classifier.
          &quot;topK&quot;: &quot;A String&quot;, # Optional. The top-k value to be used for the user defined classifier.
          &quot;topP&quot;: 3.14, # Optional. The top-p value to be used for the user defined classifier.
        },
      },
      &quot;boostControlIds&quot;: [ # Boost controls to use in serving path. All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.
        &quot;A String&quot;,
      ],
      &quot;createTime&quot;: &quot;A String&quot;, # Output only. ServingConfig created timestamp.
      &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If SearchRequest.custom_fine_tuning_spec is set, it has higher priority than the configs set here.
        &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
      },
      &quot;displayName&quot;: &quot;A String&quot;, # Required. The human readable serving config display name. Used in Discovery UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
      &quot;dissociateControlIds&quot;: [ # Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
        &quot;A String&quot;,
      ],
      &quot;diversityLevel&quot;: &quot;A String&quot;, # How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
      &quot;embeddingConfig&quot;: { # Defines embedding config, used for bring your own embeddings feature. # Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.
        &quot;fieldPath&quot;: &quot;A String&quot;, # Full field path in the schema mapped as embedding field.
      },
      &quot;filterControlIds&quot;: [ # Filter controls to use in serving path. All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.
        &quot;A String&quot;,
      ],
      &quot;genericConfig&quot;: { # Specifies the configurations needed for Generic Discovery.Currently we support: * `content_search_spec`: configuration for generic content search. # The GenericConfig of the serving configuration.
        &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # Specifies the expected behavior of content search. Only valid for content-search enabled data store.
          &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
            &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
            &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
          },
          &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
            &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
            &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
            &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
            &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
            &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
          },
          &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
          &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
            &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
            &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
            &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
          },
          &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
            &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
            &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
            &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
            &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
            &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
            &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
            &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
              &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
            },
            &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
              &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
            },
            &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
              &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
            },
            &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
            &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
          },
        },
      },
      &quot;guidedSearchSpec&quot;: { # Defines guided search spec. # Guided search configs.
        &quot;enableRefinementAttributes&quot;: True or False, # Whether or not to enable and include refinement attributes in gudied search result.
        &quot;enableRelatedQuestions&quot;: True or False, # Whether or not to enable and include related questions in search response.
        &quot;maxRelatedQuestions&quot;: 42, # Max number of related questions to be returned. The valid range is [1, 5]. If enable_related_questions is true, the default value is 3.
      },
      &quot;ignoreControlIds&quot;: [ # Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. Order does not matter. Maximum number of specifications is 100.
        &quot;A String&quot;,
      ],
      &quot;mediaConfig&quot;: { # Specifies the configurations needed for Media Discovery. Currently we support: * `demote_content_watched`: Threshold for watched content demotion. Customers can specify if using watched content demotion or use viewed detail page. Using the content watched demotion, customers need to specify the watched minutes or percentage exceeds the threshold, the content will be demoted in the recommendation result. * `promote_fresh_content`: cutoff days for fresh content promotion. Customers can specify if using content freshness promotion. If the content was published within the cutoff days, the content will be promoted in the recommendation result. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION. # The MediaConfig of the serving configuration.
        &quot;contentFreshnessCutoffDays&quot;: 42, # Specifies the content freshness used for recommendation result. Contents will be demoted if contents were published for more than content freshness cutoff days.
        &quot;contentWatchedPercentageThreshold&quot;: 3.14, # Specifies the content watched percentage threshold for demotion. Threshold value must be between [0, 1.0] inclusive.
        &quot;contentWatchedSecondsThreshold&quot;: 3.14, # Specifies the content watched minutes threshold for demotion.
        &quot;demoteContentWatchedPastDays&quot;: 42, # Optional. Specifies the number of days to look back for demoting watched content. If set to zero or unset, defaults to the maximum of 365 days.
        &quot;demotionEventType&quot;: &quot;A String&quot;, # Specifies the event type used for demoting recommendation result. Currently supported values: * `view-item`: Item viewed. * `media-play`: Start/resume watching a video, playing a song, etc. * `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.
      },
      &quot;modelId&quot;: &quot;A String&quot;, # The id of the model to use at serving time. Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.
      &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`
      &quot;onewaySynonymsControlIds&quot;: [ # Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
        &quot;A String&quot;,
      ],
      &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization spec. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
        &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
      },
      &quot;promoteControlIds&quot;: [ # Condition promote specifications. Maximum number of specifications is 100.
        &quot;A String&quot;,
      ],
      &quot;rankingExpression&quot;: &quot;A String&quot;, # The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if `SearchRequest.ranking_expression` is specified, it overrides the ServingConfig ranking expression. The ranking expression is a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
      &quot;redirectControlIds&quot;: [ # IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
        &quot;A String&quot;,
      ],
      &quot;replacementControlIds&quot;: [ # Condition replacement specifications. Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
        &quot;A String&quot;,
      ],
      &quot;solutionType&quot;: &quot;A String&quot;, # Required. Immutable. Specifies the solution type that a serving config can be associated with.
      &quot;synonymsControlIds&quot;: [ # Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
        &quot;A String&quot;,
      ],
      &quot;updateTime&quot;: &quot;A String&quot;, # Output only. ServingConfig updated timestamp.
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="list_next">list_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="patch">patch(name, body=None, updateMask=None, x__xgafv=None)</code>
  <pre>Updates a ServingConfig. Returns a NOT_FOUND error if the ServingConfig does not exist.

Args:
  name: string, Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and generates results.
  &quot;answerGenerationSpec&quot;: { # The specification for answer generation. # Optional. The specification for answer generation.
    &quot;userDefinedClassifierSpec&quot;: { # The specification for user defined classifier. # Optional. The specification for user specified classifier spec.
      &quot;enableUserDefinedClassifier&quot;: True or False, # Optional. Whether or not to enable and include user defined classifier.
      &quot;modelId&quot;: &quot;A String&quot;, # Optional. The model id to be used for the user defined classifier.
      &quot;preamble&quot;: &quot;A String&quot;, # Optional. The preamble to be used for the user defined classifier.
      &quot;seed&quot;: 42, # Optional. The seed value to be used for the user defined classifier.
      &quot;taskMarker&quot;: &quot;A String&quot;, # Optional. The task marker to be used for the user defined classifier.
      &quot;temperature&quot;: 3.14, # Optional. The temperature value to be used for the user defined classifier.
      &quot;topK&quot;: &quot;A String&quot;, # Optional. The top-k value to be used for the user defined classifier.
      &quot;topP&quot;: 3.14, # Optional. The top-p value to be used for the user defined classifier.
    },
  },
  &quot;boostControlIds&quot;: [ # Boost controls to use in serving path. All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.
    &quot;A String&quot;,
  ],
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. ServingConfig created timestamp.
  &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If SearchRequest.custom_fine_tuning_spec is set, it has higher priority than the configs set here.
    &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
  },
  &quot;displayName&quot;: &quot;A String&quot;, # Required. The human readable serving config display name. Used in Discovery UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
  &quot;dissociateControlIds&quot;: [ # Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;diversityLevel&quot;: &quot;A String&quot;, # How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;embeddingConfig&quot;: { # Defines embedding config, used for bring your own embeddings feature. # Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.
    &quot;fieldPath&quot;: &quot;A String&quot;, # Full field path in the schema mapped as embedding field.
  },
  &quot;filterControlIds&quot;: [ # Filter controls to use in serving path. All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.
    &quot;A String&quot;,
  ],
  &quot;genericConfig&quot;: { # Specifies the configurations needed for Generic Discovery.Currently we support: * `content_search_spec`: configuration for generic content search. # The GenericConfig of the serving configuration.
    &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # Specifies the expected behavior of content search. Only valid for content-search enabled data store.
      &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
        &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
        &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
      },
      &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
        &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
        &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
        &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
        &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
        &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
      },
      &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
      &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
        &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
        &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
        &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
      },
      &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
        &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
        &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
        &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
        &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
        &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
        &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
        &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
          &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
        },
        &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
          &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
        },
        &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
          &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
        },
        &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
        &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
      },
    },
  },
  &quot;guidedSearchSpec&quot;: { # Defines guided search spec. # Guided search configs.
    &quot;enableRefinementAttributes&quot;: True or False, # Whether or not to enable and include refinement attributes in gudied search result.
    &quot;enableRelatedQuestions&quot;: True or False, # Whether or not to enable and include related questions in search response.
    &quot;maxRelatedQuestions&quot;: 42, # Max number of related questions to be returned. The valid range is [1, 5]. If enable_related_questions is true, the default value is 3.
  },
  &quot;ignoreControlIds&quot;: [ # Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. Order does not matter. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;mediaConfig&quot;: { # Specifies the configurations needed for Media Discovery. Currently we support: * `demote_content_watched`: Threshold for watched content demotion. Customers can specify if using watched content demotion or use viewed detail page. Using the content watched demotion, customers need to specify the watched minutes or percentage exceeds the threshold, the content will be demoted in the recommendation result. * `promote_fresh_content`: cutoff days for fresh content promotion. Customers can specify if using content freshness promotion. If the content was published within the cutoff days, the content will be promoted in the recommendation result. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION. # The MediaConfig of the serving configuration.
    &quot;contentFreshnessCutoffDays&quot;: 42, # Specifies the content freshness used for recommendation result. Contents will be demoted if contents were published for more than content freshness cutoff days.
    &quot;contentWatchedPercentageThreshold&quot;: 3.14, # Specifies the content watched percentage threshold for demotion. Threshold value must be between [0, 1.0] inclusive.
    &quot;contentWatchedSecondsThreshold&quot;: 3.14, # Specifies the content watched minutes threshold for demotion.
    &quot;demoteContentWatchedPastDays&quot;: 42, # Optional. Specifies the number of days to look back for demoting watched content. If set to zero or unset, defaults to the maximum of 365 days.
    &quot;demotionEventType&quot;: &quot;A String&quot;, # Specifies the event type used for demoting recommendation result. Currently supported values: * `view-item`: Item viewed. * `media-play`: Start/resume watching a video, playing a song, etc. * `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.
  },
  &quot;modelId&quot;: &quot;A String&quot;, # The id of the model to use at serving time. Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`
  &quot;onewaySynonymsControlIds&quot;: [ # Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization spec. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
    &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
  },
  &quot;promoteControlIds&quot;: [ # Condition promote specifications. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;rankingExpression&quot;: &quot;A String&quot;, # The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if `SearchRequest.ranking_expression` is specified, it overrides the ServingConfig ranking expression. The ranking expression is a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
  &quot;redirectControlIds&quot;: [ # IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;replacementControlIds&quot;: [ # Condition replacement specifications. Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;solutionType&quot;: &quot;A String&quot;, # Required. Immutable. Specifies the solution type that a serving config can be associated with.
  &quot;synonymsControlIds&quot;: [ # Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. ServingConfig updated timestamp.
}

  updateMask: string, Indicates which fields in the provided ServingConfig to update. The following are NOT supported: * ServingConfig.name If not set, all supported fields are updated.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Configures metadata that is used to generate serving time results (e.g. search results or recommendation predictions). The ServingConfig is passed in the search and predict request and generates results.
  &quot;answerGenerationSpec&quot;: { # The specification for answer generation. # Optional. The specification for answer generation.
    &quot;userDefinedClassifierSpec&quot;: { # The specification for user defined classifier. # Optional. The specification for user specified classifier spec.
      &quot;enableUserDefinedClassifier&quot;: True or False, # Optional. Whether or not to enable and include user defined classifier.
      &quot;modelId&quot;: &quot;A String&quot;, # Optional. The model id to be used for the user defined classifier.
      &quot;preamble&quot;: &quot;A String&quot;, # Optional. The preamble to be used for the user defined classifier.
      &quot;seed&quot;: 42, # Optional. The seed value to be used for the user defined classifier.
      &quot;taskMarker&quot;: &quot;A String&quot;, # Optional. The task marker to be used for the user defined classifier.
      &quot;temperature&quot;: 3.14, # Optional. The temperature value to be used for the user defined classifier.
      &quot;topK&quot;: &quot;A String&quot;, # Optional. The top-k value to be used for the user defined classifier.
      &quot;topP&quot;: 3.14, # Optional. The top-p value to be used for the user defined classifier.
    },
  },
  &quot;boostControlIds&quot;: [ # Boost controls to use in serving path. All triggered boost controls will be applied. Boost controls must be in the same data store as the serving config. Maximum of 20 boost controls.
    &quot;A String&quot;,
  ],
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. ServingConfig created timestamp.
  &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If SearchRequest.custom_fine_tuning_spec is set, it has higher priority than the configs set here.
    &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
  },
  &quot;displayName&quot;: &quot;A String&quot;, # Required. The human readable serving config display name. Used in Discovery UI. This field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.
  &quot;dissociateControlIds&quot;: [ # Condition do not associate specifications. If multiple do not associate conditions match, all matching do not associate controls in the list will execute. Order does not matter. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;diversityLevel&quot;: &quot;A String&quot;, # How much diversity to use in recommendation model results e.g. `medium-diversity` or `high-diversity`. Currently supported values: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` If not specified, we choose default based on recommendation model type. Default value: `no-diversity`. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;embeddingConfig&quot;: { # Defines embedding config, used for bring your own embeddings feature. # Bring your own embedding config. The config is used for search semantic retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embeddings that are provided by this EmbeddingConfig. If SearchRequest.EmbeddingSpec.EmbeddingVector.vector is provided, it overrides this ServingConfig.embedding_config.
    &quot;fieldPath&quot;: &quot;A String&quot;, # Full field path in the schema mapped as embedding field.
  },
  &quot;filterControlIds&quot;: [ # Filter controls to use in serving path. All triggered filter controls will be applied. Filter controls must be in the same data store as the serving config. Maximum of 20 filter controls.
    &quot;A String&quot;,
  ],
  &quot;genericConfig&quot;: { # Specifies the configurations needed for Generic Discovery.Currently we support: * `content_search_spec`: configuration for generic content search. # The GenericConfig of the serving configuration.
    &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # Specifies the expected behavior of content search. Only valid for content-search enabled data store.
      &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
        &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
        &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
      },
      &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
        &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
        &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
        &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
        &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
        &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
      },
      &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
      &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
        &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
        &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
        &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
      },
      &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
        &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
        &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
        &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
        &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
        &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
        &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
        &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
          &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
        },
        &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
          &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
        },
        &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
          &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
        },
        &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
        &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
      },
    },
  },
  &quot;guidedSearchSpec&quot;: { # Defines guided search spec. # Guided search configs.
    &quot;enableRefinementAttributes&quot;: True or False, # Whether or not to enable and include refinement attributes in gudied search result.
    &quot;enableRelatedQuestions&quot;: True or False, # Whether or not to enable and include related questions in search response.
    &quot;maxRelatedQuestions&quot;: 42, # Max number of related questions to be returned. The valid range is [1, 5]. If enable_related_questions is true, the default value is 3.
  },
  &quot;ignoreControlIds&quot;: [ # Condition ignore specifications. If multiple ignore conditions match, all matching ignore controls in the list will execute. Order does not matter. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;mediaConfig&quot;: { # Specifies the configurations needed for Media Discovery. Currently we support: * `demote_content_watched`: Threshold for watched content demotion. Customers can specify if using watched content demotion or use viewed detail page. Using the content watched demotion, customers need to specify the watched minutes or percentage exceeds the threshold, the content will be demoted in the recommendation result. * `promote_fresh_content`: cutoff days for fresh content promotion. Customers can specify if using content freshness promotion. If the content was published within the cutoff days, the content will be promoted in the recommendation result. Can only be set if SolutionType is SOLUTION_TYPE_RECOMMENDATION. # The MediaConfig of the serving configuration.
    &quot;contentFreshnessCutoffDays&quot;: 42, # Specifies the content freshness used for recommendation result. Contents will be demoted if contents were published for more than content freshness cutoff days.
    &quot;contentWatchedPercentageThreshold&quot;: 3.14, # Specifies the content watched percentage threshold for demotion. Threshold value must be between [0, 1.0] inclusive.
    &quot;contentWatchedSecondsThreshold&quot;: 3.14, # Specifies the content watched minutes threshold for demotion.
    &quot;demoteContentWatchedPastDays&quot;: 42, # Optional. Specifies the number of days to look back for demoting watched content. If set to zero or unset, defaults to the maximum of 365 days.
    &quot;demotionEventType&quot;: &quot;A String&quot;, # Specifies the event type used for demoting recommendation result. Currently supported values: * `view-item`: Item viewed. * `media-play`: Start/resume watching a video, playing a song, etc. * `media-complete`: Finished or stopped midway through a video, song, etc. If unset, watch history demotion will not be applied. Content freshness demotion will still be applied.
  },
  &quot;modelId&quot;: &quot;A String&quot;, # The id of the model to use at serving time. Currently only RecommendationModels are supported. Can be changed but only to a compatible model (e.g. others-you-may-like CTR to others-you-may-like CVR). Required when SolutionType is SOLUTION_TYPE_RECOMMENDATION.
  &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}/servingConfigs/{serving_config_id}`
  &quot;onewaySynonymsControlIds&quot;: [ # Condition oneway synonyms specifications. If multiple oneway synonyms conditions match, all matching oneway synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization spec. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
    &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
  },
  &quot;promoteControlIds&quot;: [ # Condition promote specifications. Maximum number of specifications is 100.
    &quot;A String&quot;,
  ],
  &quot;rankingExpression&quot;: &quot;A String&quot;, # The ranking expression controls the customized ranking on retrieval documents. To leverage this, document embedding is required. The ranking expression setting in ServingConfig applies to all search requests served by the serving config. However, if `SearchRequest.ranking_expression` is specified, it overrides the ServingConfig ranking expression. The ranking expression is a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between embedding_field_path and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
  &quot;redirectControlIds&quot;: [ # IDs of the redirect controls. Only the first triggered redirect action is applied, even if multiple apply. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;replacementControlIds&quot;: [ # Condition replacement specifications. Applied according to the order in the list. A previously replaced term can not be re-replaced. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;solutionType&quot;: &quot;A String&quot;, # Required. Immutable. Specifies the solution type that a serving config can be associated with.
  &quot;synonymsControlIds&quot;: [ # Condition synonyms specifications. If multiple synonyms conditions match, all matching synonyms controls in the list will execute. Maximum number of specifications is 100. Can only be set if SolutionType is SOLUTION_TYPE_SEARCH.
    &quot;A String&quot;,
  ],
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. ServingConfig updated timestamp.
}</pre>
</div>

<div class="method">
    <code class="details" id="recommend">recommend(servingConfig, body=None, x__xgafv=None)</code>
  <pre>Makes a recommendation, which requires a contextual user event.

Args:
  servingConfig: string, Required. Full resource name of a ServingConfig: `projects/*/locations/global/collections/*/engines/*/servingConfigs/*`, or `projects/*/locations/global/collections/*/dataStores/*/servingConfigs/*` One default serving config is created along with your recommendation engine creation. The engine ID is used as the ID of the default serving config. For example, for Engine `projects/*/locations/global/collections/*/engines/my-engine`, you can use `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine` for your RecommendationService.Recommend requests. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for Recommend method.
  &quot;filter&quot;: &quot;A String&quot;, # Filter for restricting recommendation results with a length limit of 5,000 characters. Currently, only filter expressions on the `filter_tags` attribute is supported. Examples: * `(filter_tags: ANY(&quot;Red&quot;, &quot;Blue&quot;) OR filter_tags: ANY(&quot;Hot&quot;, &quot;Cold&quot;))` * `(filter_tags: ANY(&quot;Red&quot;, &quot;Blue&quot;)) AND NOT (filter_tags: ANY(&quot;Green&quot;))` If `attributeFilteringSyntax` is set to true under the `params` field, then attribute-based expressions are expected instead of the above described tag-based syntax. Examples: * (language: ANY(&quot;en&quot;, &quot;es&quot;)) AND NOT (categories: ANY(&quot;Movie&quot;)) * (available: true) AND (language: ANY(&quot;en&quot;, &quot;es&quot;)) OR (categories: ANY(&quot;Movie&quot;)) If your filter blocks all results, the API returns generic (unfiltered) popular Documents. If you only want results strictly matching the filters, set `strictFiltering` to `true` in RecommendRequest.params to receive empty results instead. Note that the API never returns Documents with `storageStatus` as `EXPIRED` or `DELETED` regardless of filter choices.
  &quot;pageSize&quot;: 42, # Maximum number of results to return. Set this property to the number of recommendation results needed. If zero, the service chooses a reasonable default. The maximum allowed value is 100. Values above 100 are set to 100.
  &quot;params&quot;: { # Additional domain specific parameters for the recommendations. Allowed values: * `returnDocument`: Boolean. If set to `true`, the associated Document object is returned in RecommendResponse.RecommendationResult.document. * `returnScore`: Boolean. If set to true, the recommendation score corresponding to each returned Document is set in RecommendResponse.RecommendationResult.metadata. The given score indicates the probability of a Document conversion given the user&#x27;s context and history. * `strictFiltering`: Boolean. True by default. If set to `false`, the service returns generic (unfiltered) popular Documents instead of empty if your filter blocks all recommendation results. * `diversityLevel`: String. Default empty. If set to be non-empty, then it needs to be one of: * `no-diversity` * `low-diversity` * `medium-diversity` * `high-diversity` * `auto-diversity` This gives request-level control and adjusts recommendation results based on Document category. * `attributeFilteringSyntax`: Boolean. False by default. If set to true, the `filter` field is interpreted according to the new, attribute-based syntax.
    &quot;a_key&quot;: &quot;&quot;,
  },
  &quot;userEvent&quot;: { # UserEvent captures all metadata information Discovery Engine API needs to know about how end users interact with your website. # Required. Context about the user, what they are looking at and what action they took to trigger the Recommend request. Note that this user event detail won&#x27;t be ingested to userEvent logs. Thus, a separate userEvent write request is required for event logging. Don&#x27;t set UserEvent.user_pseudo_id or UserEvent.user_info.user_id to the same fixed ID for different users. If you are trying to receive non-personalized recommendations (not recommended; this can negatively impact model performance), instead set UserEvent.user_pseudo_id to a random unique ID and leave UserEvent.user_info.user_id unset.
    &quot;attributes&quot;: { # Extra user event features to include in the recommendation model. These attributes must NOT contain data that needs to be parsed or processed further, e.g. JSON or other encodings. If you provide custom attributes for ingested user events, also include them in the user events that you associate with prediction requests. Custom attribute formatting must be consistent between imported events and events provided with prediction requests. This lets the Discovery Engine API use those custom attributes when training models and serving predictions, which helps improve recommendation quality. This field needs to pass all below criteria, otherwise an `INVALID_ARGUMENT` error is returned: * The key must be a UTF-8 encoded string with a length limit of 5,000 characters. * For text attributes, at most 400 values are allowed. Empty values are not allowed. Each value must be a UTF-8 encoded string with a length limit of 256 characters. * For number attributes, at most 400 values are allowed. For product recommendations, an example of extra user information is `traffic_channel`, which is how a user arrives at the site. Users can arrive at the site by coming to the site directly, coming through Google search, or in other ways.
      &quot;a_key&quot;: { # A custom attribute that is not explicitly modeled in a resource, e.g. UserEvent.
        &quot;numbers&quot;: [ # The numerical values of this custom attribute. For example, `[2.3, 15.4]` when the key is &quot;lengths_cm&quot;. Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
          3.14,
        ],
        &quot;text&quot;: [ # The textual values of this custom attribute. For example, `[&quot;yellow&quot;, &quot;green&quot;]` when the key is &quot;color&quot;. Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is returned. Exactly one of CustomAttribute.text or CustomAttribute.numbers should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
          &quot;A String&quot;,
        ],
      },
    },
    &quot;attributionToken&quot;: &quot;A String&quot;, # Token to attribute an API response to user action(s) to trigger the event. Highly recommended for user events that are the result of RecommendationService.Recommend. This field enables accurate attribution of recommendation model performance. The value must be one of: * RecommendResponse.attribution_token for events that are the result of RecommendationService.Recommend. * SearchResponse.attribution_token for events that are the result of SearchService.Search. This token enables us to accurately attribute page view or conversion completion back to the event and the particular predict response containing this clicked/purchased product. If user clicks on product K in the recommendation results, pass RecommendResponse.attribution_token as a URL parameter to product K&#x27;s page. When recording events on product K&#x27;s page, log the RecommendResponse.attribution_token to this field.
    &quot;completionInfo&quot;: { # Detailed completion information including completion attribution token and clicked completion info. # CompletionService.CompleteQuery details related to the event. This field should be set for `search` event when autocomplete function is enabled and the user clicks a suggestion for search.
      &quot;selectedPosition&quot;: 42, # End user selected CompleteQueryResponse.QuerySuggestion.suggestion position, starting from 0.
      &quot;selectedSuggestion&quot;: &quot;A String&quot;, # End user selected CompleteQueryResponse.QuerySuggestion.suggestion.
    },
    &quot;conversionType&quot;: &quot;A String&quot;, # Optional. Conversion type. Required if UserEvent.event_type is `conversion`. This is a customer-defined conversion name in lowercase letters or numbers separated by &quot;-&quot;, such as &quot;watch&quot;, &quot;good-visit&quot; etc. Do not set the field if UserEvent.event_type is not `conversion`. This mixes the custom conversion event with predefined events like `search`, `view-item` etc.
    &quot;dataStore&quot;: &quot;A String&quot;, # The DataStore resource full name, of the form `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. Optional. Only required for user events whose data store can&#x27;t by determined by UserEvent.engine or UserEvent.documents. If data store is set in the parent of write/import/collect user event requests, this field can be omitted.
    &quot;directUserRequest&quot;: True or False, # Should set to true if the request is made directly from the end user, in which case the UserEvent.user_info.user_agent can be populated from the HTTP request. This flag should be set only if the API request is made directly from the end user such as a mobile app (and not if a gateway or a server is processing and pushing the user events). This should not be set when using the JavaScript tag in UserEventService.CollectUserEvent.
    &quot;documents&quot;: [ # List of Documents associated with this user event. This field is optional except for the following event types: * `view-item` * `add-to-cart` * `purchase` * `media-play` * `media-complete` In a `search` event, this field represents the documents returned to the end user on the current page (the end user may have not finished browsing the whole page yet). When a new page is returned to the end user, after pagination/filtering/ordering even for the same query, a new `search` event with different UserEvent.documents is desired.
      { # Detailed document information associated with a user event.
        &quot;conversionValue&quot;: 3.14, # Optional. The conversion value associated with this Document. Must be set if UserEvent.event_type is &quot;conversion&quot;. For example, a value of 1000 signifies that 1000 seconds were spent viewing a Document for the `watch` conversion type.
        &quot;id&quot;: &quot;A String&quot;, # The Document resource ID.
        &quot;joined&quot;: True or False, # Output only. Whether the referenced Document can be found in the data store.
        &quot;name&quot;: &quot;A String&quot;, # The Document resource full name, of the form: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
        &quot;promotionIds&quot;: [ # The promotion IDs associated with this Document. Currently, this field is restricted to at most one ID.
          &quot;A String&quot;,
        ],
        &quot;quantity&quot;: 42, # Quantity of the Document associated with the user event. Defaults to 1. For example, this field is 2 if two quantities of the same Document are involved in a `add-to-cart` event. Required for events of the following event types: * `add-to-cart` * `purchase`
        &quot;uri&quot;: &quot;A String&quot;, # The Document URI - only allowed for website data stores.
      },
    ],
    &quot;engine&quot;: &quot;A String&quot;, # The Engine resource name, in the form of `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`. Optional. Only required for Engine produced user events. For example, user events from blended search.
    &quot;eventTime&quot;: &quot;A String&quot;, # Only required for UserEventService.ImportUserEvents method. Timestamp of when the user event happened.
    &quot;eventType&quot;: &quot;A String&quot;, # Required. User event type. Allowed values are: Generic values: * `search`: Search for Documents. * `view-item`: Detailed page view of a Document. * `view-item-list`: View of a panel or ordered list of Documents. * `view-home-page`: View of the home page. * `view-category-page`: View of a category page, e.g. Home &gt; Men &gt; Jeans Retail-related values: * `add-to-cart`: Add an item(s) to cart, e.g. in Retail online shopping * `purchase`: Purchase an item(s) Media-related values: * `media-play`: Start/resume watching a video, playing a song, etc. * `media-complete`: Finished or stopped midway through a video, song, etc. Custom conversion value: * `conversion`: Customer defined conversion event.
    &quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. One example is for `search` events, the associated SearchRequest may contain a filter expression in SearchRequest.filter conforming to https://google.aip.dev/160#filtering. Similarly, for `view-item-list` events that are generated from a RecommendRequest, this field may be populated directly from RecommendRequest.filter conforming to https://google.aip.dev/160#filtering. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    &quot;mediaInfo&quot;: { # Media-specific user event information. # Media-specific info.
      &quot;mediaProgressDuration&quot;: &quot;A String&quot;, # The media progress time in seconds, if applicable. For example, if the end user has finished 90 seconds of a playback video, then MediaInfo.media_progress_duration.seconds should be set to 90.
      &quot;mediaProgressPercentage&quot;: 3.14, # Media progress should be computed using only the media_progress_duration relative to the media total length. This value must be between `[0, 1.0]` inclusive. If this is not a playback or the progress cannot be computed (e.g. ongoing livestream), this field should be unset.
    },
    &quot;pageInfo&quot;: { # Detailed page information. # Page metadata such as categories and other critical information for certain event types such as `view-category-page`.
      &quot;pageCategory&quot;: &quot;A String&quot;, # The most specific category associated with a category page. To represent full path of category, use &#x27;&gt;&#x27; sign to separate different hierarchies. If &#x27;&gt;&#x27; is part of the category name, replace it with other character(s). Category pages include special pages such as sales or promotions. For instance, a special sale page may have the category hierarchy: `&quot;pageCategory&quot; : &quot;Sales &gt; 2017 Black Friday Deals&quot;`. Required for `view-category-page` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      &quot;pageviewId&quot;: &quot;A String&quot;, # A unique ID of a web page view. This should be kept the same for all user events triggered from the same pageview. For example, an item detail page view could trigger multiple events as the user is browsing the page. The `pageview_id` property should be kept the same for all these events so that they can be grouped together properly. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically.
      &quot;referrerUri&quot;: &quot;A String&quot;, # The referrer URL of the current page. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically. However, some browser privacy restrictions may cause this field to be empty.
      &quot;uri&quot;: &quot;A String&quot;, # Complete URL (window.location.href) of the user&#x27;s current page. When using the client side event reporting with JavaScript pixel and Google Tag Manager, this value is filled in automatically. Maximum length 5,000 characters.
    },
    &quot;panel&quot;: { # Detailed panel information associated with a user event. # Panel metadata associated with this user event.
      &quot;displayName&quot;: &quot;A String&quot;, # The display name of the panel.
      &quot;documents&quot;: [ # Optional. The document IDs associated with this panel.
        { # Detailed document information associated with a user event.
          &quot;conversionValue&quot;: 3.14, # Optional. The conversion value associated with this Document. Must be set if UserEvent.event_type is &quot;conversion&quot;. For example, a value of 1000 signifies that 1000 seconds were spent viewing a Document for the `watch` conversion type.
          &quot;id&quot;: &quot;A String&quot;, # The Document resource ID.
          &quot;joined&quot;: True or False, # Output only. Whether the referenced Document can be found in the data store.
          &quot;name&quot;: &quot;A String&quot;, # The Document resource full name, of the form: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
          &quot;promotionIds&quot;: [ # The promotion IDs associated with this Document. Currently, this field is restricted to at most one ID.
            &quot;A String&quot;,
          ],
          &quot;quantity&quot;: 42, # Quantity of the Document associated with the user event. Defaults to 1. For example, this field is 2 if two quantities of the same Document are involved in a `add-to-cart` event. Required for events of the following event types: * `add-to-cart` * `purchase`
          &quot;uri&quot;: &quot;A String&quot;, # The Document URI - only allowed for website data stores.
        },
      ],
      &quot;panelId&quot;: &quot;A String&quot;, # Required. The panel ID.
      &quot;panelPosition&quot;: 42, # The ordered position of the panel, if shown to the user with other panels. If set, then total_panels must also be set.
      &quot;totalPanels&quot;: 42, # The total number of panels, including this one, shown to the user. Must be set if panel_position is set.
    },
    &quot;panels&quot;: [ # Optional. List of panels associated with this event. Used for page-level impression data.
      { # Detailed panel information associated with a user event.
        &quot;displayName&quot;: &quot;A String&quot;, # The display name of the panel.
        &quot;documents&quot;: [ # Optional. The document IDs associated with this panel.
          { # Detailed document information associated with a user event.
            &quot;conversionValue&quot;: 3.14, # Optional. The conversion value associated with this Document. Must be set if UserEvent.event_type is &quot;conversion&quot;. For example, a value of 1000 signifies that 1000 seconds were spent viewing a Document for the `watch` conversion type.
            &quot;id&quot;: &quot;A String&quot;, # The Document resource ID.
            &quot;joined&quot;: True or False, # Output only. Whether the referenced Document can be found in the data store.
            &quot;name&quot;: &quot;A String&quot;, # The Document resource full name, of the form: `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/branches/{branch_id}/documents/{document_id}`
            &quot;promotionIds&quot;: [ # The promotion IDs associated with this Document. Currently, this field is restricted to at most one ID.
              &quot;A String&quot;,
            ],
            &quot;quantity&quot;: 42, # Quantity of the Document associated with the user event. Defaults to 1. For example, this field is 2 if two quantities of the same Document are involved in a `add-to-cart` event. Required for events of the following event types: * `add-to-cart` * `purchase`
            &quot;uri&quot;: &quot;A String&quot;, # The Document URI - only allowed for website data stores.
          },
        ],
        &quot;panelId&quot;: &quot;A String&quot;, # Required. The panel ID.
        &quot;panelPosition&quot;: 42, # The ordered position of the panel, if shown to the user with other panels. If set, then total_panels must also be set.
        &quot;totalPanels&quot;: 42, # The total number of panels, including this one, shown to the user. Must be set if panel_position is set.
      },
    ],
    &quot;promotionIds&quot;: [ # The promotion IDs if this is an event associated with promotions. Currently, this field is restricted to at most one ID.
      &quot;A String&quot;,
    ],
    &quot;searchInfo&quot;: { # Detailed search information. # SearchService.Search details related to the event. This field should be set for `search` event.
      &quot;offset&quot;: 42, # An integer that specifies the current offset for pagination (the 0-indexed starting location, amongst the products deemed by the API as relevant). See SearchRequest.offset for definition. If this field is negative, an `INVALID_ARGUMENT` is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      &quot;orderBy&quot;: &quot;A String&quot;, # The order in which products are returned, if applicable. See SearchRequest.order_by for definition and syntax. The value must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This can only be set for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
      &quot;searchQuery&quot;: &quot;A String&quot;, # The user&#x27;s search query. See SearchRequest.query for definition. The value must be a UTF-8 encoded string with a length limit of 5,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. At least one of search_query or PageInfo.page_category is required for `search` events. Other event types should not set this field. Otherwise, an `INVALID_ARGUMENT` error is returned.
    },
    &quot;sessionId&quot;: &quot;A String&quot;, # A unique identifier for tracking a visitor session with a length limit of 128 bytes. A session is an aggregation of an end user behavior in a time span. A general guideline to populate the session_id: 1. If user has no activity for 30 min, a new session_id should be assigned. 2. The session_id should be unique across users, suggest use uuid or add UserEvent.user_pseudo_id as prefix.
    &quot;tagIds&quot;: [ # A list of identifiers for the independent experiment groups this user event belongs to. This is used to distinguish between user events associated with different experiment setups.
      &quot;A String&quot;,
    ],
    &quot;transactionInfo&quot;: { # A transaction represents the entire purchase transaction. # The transaction metadata (if any) associated with this user event.
      &quot;cost&quot;: 3.14, # All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that: * Profit = value - tax - cost
      &quot;currency&quot;: &quot;A String&quot;, # Required. Currency code. Use three-character ISO-4217 code.
      &quot;discountValue&quot;: 3.14, # The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value: * Profit = value - tax - cost
      &quot;tax&quot;: 3.14, # All the taxes associated with the transaction.
      &quot;transactionId&quot;: &quot;A String&quot;, # The transaction ID with a length limit of 128 characters.
      &quot;value&quot;: 3.14, # Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.
    },
    &quot;userInfo&quot;: { # Information of an end user. # Information about the end user.
      &quot;timeZone&quot;: &quot;A String&quot;, # Optional. IANA time zone, e.g. Europe/Budapest.
      &quot;userAgent&quot;: &quot;A String&quot;, # User agent as included in the HTTP header. The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.
      &quot;userId&quot;: &quot;A String&quot;, # Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don&#x27;t set for anonymous users. Always use a hashed value for this ID. Don&#x27;t set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
    },
    &quot;userPseudoId&quot;: &quot;A String&quot;, # Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor log in/out of the website. Do not set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. The field should not contain PII or user-data. We recommend to use Google Analytics [Client ID](https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#clientId) for this field.
  },
  &quot;userLabels&quot;: { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Requirements for labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;validateOnly&quot;: True or False, # Use validate only mode for this recommendation query. If set to `true`, a fake model is used that returns arbitrary Document IDs. Note that the validate only mode should only be used for testing the API, or if the model is not ready.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for Recommend method.
  &quot;attributionToken&quot;: &quot;A String&quot;, # A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.
  &quot;missingIds&quot;: [ # IDs of documents in the request that were missing from the default Branch associated with the requested ServingConfig.
    &quot;A String&quot;,
  ],
  &quot;results&quot;: [ # A list of recommended Documents. The order represents the ranking (from the most relevant Document to the least).
    { # RecommendationResult represents a generic recommendation result with associated metadata.
      &quot;document&quot;: { # Document captures all raw metadata information of items to be recommended or searched. # Set if `returnDocument` is set to true in RecommendRequest.params.
        &quot;aclInfo&quot;: { # ACL Information of the Document. # Access control information for the document.
          &quot;readers&quot;: [ # Readers of the document.
            { # AclRestriction to model complex inheritance restrictions. Example: Modeling a &quot;Both Permit&quot; inheritance, where to access a child document, user needs to have access to parent document. Document Hierarchy - Space_S --&gt; Page_P. Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2 Space_S ACL Restriction - { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ] } ] } } Page_P ACL Restriction. { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_2&quot; }, { &quot;group_id&quot;: &quot;group_3&quot; }, { &quot;user_id&quot;: &quot;user_2&quot; } ], }, { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ], } ] } }
              &quot;idpWide&quot;: True or False, # All users within the Identity Provider.
              &quot;principals&quot;: [ # List of principals.
                { # Principal identifier of a user or a group.
                  &quot;externalEntityId&quot;: &quot;A String&quot;, # For 3P application identities which are not present in the customer identity provider.
                  &quot;groupId&quot;: &quot;A String&quot;, # Group identifier. For Google Workspace user account, group_id should be the google workspace group email. For non-google identity provider user account, group_id is the mapped group identifier configured during the workforcepool config.
                  &quot;userId&quot;: &quot;A String&quot;, # User identifier. For Google Workspace user account, user_id should be the google workspace user email. For non-google identity provider user account, user_id is the mapped user identifier configured during the workforcepool config.
                },
              ],
            },
          ],
        },
        &quot;content&quot;: { # Unstructured data linked to this document. # The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
          &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `text/plain` (TXT) * `application/xml` or `text/xml` (XML) * `application/json` (JSON) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: * `image/bmp` (BMP) * `image/gif` (GIF) * `image/jpeg` (JPEG) * `image/png` (PNG) * `image/tiff` (TIFF) See https://www.iana.org/assignments/media-types/media-types.xhtml.
          &quot;rawBytes&quot;: &quot;A String&quot;, # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&amp;()&#x27;-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.
          &quot;uri&quot;: &quot;A String&quot;, # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.
        },
        &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;id&quot;: &quot;A String&quot;, # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters.
        &quot;indexStatus&quot;: { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document&#x27;s index is in progress, the pending_message field is populated.
          &quot;errorSamples&quot;: [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
            { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
              &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
              &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                {
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                },
              ],
              &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
            },
          ],
          &quot;indexTime&quot;: &quot;A String&quot;, # The time when the document was indexed. If this field is populated, it means the document has been indexed.
          &quot;pendingMessage&quot;: &quot;A String&quot;, # Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
        },
        &quot;indexTime&quot;: &quot;A String&quot;, # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
        &quot;jsonData&quot;: &quot;A String&quot;, # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
        &quot;name&quot;: &quot;A String&quot;, # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
        &quot;parentDocumentId&quot;: &quot;A String&quot;, # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
        &quot;schemaId&quot;: &quot;A String&quot;, # The identifier of the schema located in the same data store.
        &quot;structData&quot;: { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
      },
      &quot;id&quot;: &quot;A String&quot;, # Resource ID of the recommended Document.
      &quot;metadata&quot;: { # Additional Document metadata or annotations. Possible values: * `score`: Recommendation score in double value. Is set if `returnScore` is set to true in RecommendRequest.params.
        &quot;a_key&quot;: &quot;&quot;,
      },
    },
  ],
  &quot;validateOnly&quot;: True or False, # True if RecommendRequest.validate_only was set.
}</pre>
</div>

<div class="method">
    <code class="details" id="search">search(servingConfig, body=None, x__xgafv=None)</code>
  <pre>Performs a search.

Args:
  servingConfig: string, Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for SearchService.Search method.
  &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
    &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
      { # Boost applies to documents which match a condition.
        &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
        &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
          &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
          &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
            { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
              &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
              &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
            },
          ],
          &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
          &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
        },
        &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
      },
    ],
  },
  &quot;branch&quot;: &quot;A String&quot;, # The branch resource name, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. Use `default_branch` as the branch ID or leave this field empty, to search documents under the default branch.
  &quot;canonicalFilter&quot;: &quot;A String&quot;, # The default filter that is applied when a user performs a search without checking any filters on the search page. The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality. For more information about filter syntax, see SearchRequest.filter.
  &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # A specification for configuring the behavior of content search.
    &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
      &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
      &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
    },
    &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
      &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
      &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
      &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
      &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
      &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
    },
    &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
    &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
      &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
      &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
      &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    },
    &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
      &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
      &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
      &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
      &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
      &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
      &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
      &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
        &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
      },
      &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
        &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      },
      &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
        &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
      },
      &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
      &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
    },
  },
  &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If set, it has higher priority than the configs set in ServingConfig.custom_fine_tuning_spec.
    &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
  },
  &quot;dataStoreSpecs&quot;: [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. For engines with a single data store, the specs directly under SearchRequest should be used.
    { # A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error is returned.
      &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Optional. Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
        &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
          { # Boost applies to documents which match a condition.
            &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
            &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
              &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
              &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                  &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                  &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                },
              ],
              &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
              &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
            },
            &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
          },
        ],
      },
      &quot;customSearchOperators&quot;: &quot;A String&quot;, # Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
      &quot;dataStore&quot;: &quot;A String&quot;, # Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. The path must include the project number, project id is not supported for this field.
      &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    },
  ],
  &quot;displaySpec&quot;: { # Specifies features for display, like match highlighting. # Optional. Config for display feature, like match highlighting on search results.
    &quot;matchHighlightingCondition&quot;: &quot;A String&quot;, # The condition under which match highlighting should occur.
  },
  &quot;embeddingSpec&quot;: { # The specification that uses customized query embedding vector to do semantic document retrieval. # Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embedding that is provided in SearchRequest.EmbeddingSpec.EmbeddingVector.field_path. If SearchRequest.EmbeddingSpec.EmbeddingVector.field_path is not provided, it will use ServingConfig.EmbeddingConfig.field_path.
    &quot;embeddingVectors&quot;: [ # The embedding vector used for retrieval. Limit to 1.
      { # Embedding vector.
        &quot;fieldPath&quot;: &quot;A String&quot;, # Embedding field path in schema.
        &quot;vector&quot;: [ # Query embedding vector.
          3.14,
        ],
      },
    ],
  },
  &quot;facetSpecs&quot;: [ # Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
    { # A facet specification to perform faceted search.
      &quot;enableDynamicPosition&quot;: True or False, # Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined automatically. If dynamic facets are enabled, it is ordered together. If set to false, the position of this facet in the response is the same as in the request, and it is ranked before the facets with dynamic position enable and all dynamic facets. For example, you may always want to have rating facet returned in the response, but it&#x27;s not necessarily to always display the rating facet at the top. In that case, you can set enable_dynamic_position to true so that the position of rating facet in response is determined automatically. Another example, assuming you have the following facets in the request: * &quot;rating&quot;, enable_dynamic_position = true * &quot;price&quot;, enable_dynamic_position = false * &quot;brands&quot;, enable_dynamic_position = false And also you have a dynamic facets enabled, which generates a facet `gender`. Then the final order of the facets in the response can be (&quot;price&quot;, &quot;brands&quot;, &quot;rating&quot;, &quot;gender&quot;) or (&quot;price&quot;, &quot;brands&quot;, &quot;gender&quot;, &quot;rating&quot;) depends on how API orders &quot;gender&quot; and &quot;rating&quot; facets. However, notice that &quot;price&quot; and &quot;brands&quot; are always ranked at first and second position because their enable_dynamic_position is false.
      &quot;excludedFilterKeys&quot;: [ # List of keys to exclude when faceting. By default, FacetKey.key is not excluded from the filter unless it is listed in this field. Listing a facet key in this field allows its values to appear as facet results, even when they are filtered out of search results. Using this field does not affect what search results are returned. For example, suppose there are 100 documents with the color facet &quot;Red&quot; and 200 documents with the color facet &quot;Blue&quot;. A query containing the filter &quot;color:ANY(&quot;Red&quot;)&quot; and having &quot;color&quot; as FacetKey.key would by default return only &quot;Red&quot; documents in the search results, and also return &quot;Red&quot; with count 100 as the only color facet. Although there are also blue documents available, &quot;Blue&quot; would not be shown as an available facet value. If &quot;color&quot; is listed in &quot;excludedFilterKeys&quot;, then the query returns the facet values &quot;Red&quot; with count 100 and &quot;Blue&quot; with count 200, because the &quot;color&quot; key is now excluded from the filter. Because this field doesn&#x27;t affect search results, the search results are still correctly filtered to return only &quot;Red&quot; documents. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
        &quot;A String&quot;,
      ],
      &quot;facetKey&quot;: { # Specifies how a facet is computed. # Required. The facet key specification.
        &quot;caseInsensitive&quot;: True or False, # True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.
        &quot;contains&quot;: [ # Only get facet values that contain the given strings. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;contains&quot; to &quot;2022&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot; and &quot;Sci-Fi &gt; 2022&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
        &quot;intervals&quot;: [ # Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.
          { # A floating point interval.
            &quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
            &quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
            &quot;maximum&quot;: 3.14, # Inclusive upper bound.
            &quot;minimum&quot;: 3.14, # Inclusive lower bound.
          },
        ],
        &quot;key&quot;: &quot;A String&quot;, # Required. Supported textual and numerical facet keys in Document object, over which the facet values are computed. Facet key is case-sensitive.
        &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Allowed values are: * &quot;count desc&quot;, which means order by SearchResponse.Facet.values.count descending. * &quot;value desc&quot;, which means order by SearchResponse.Facet.values.value descending. Only applies to textual facets. If not set, textual values are sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals.
        &quot;prefixes&quot;: [ # Only get facet values that start with the given string prefix. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;prefixes&quot; to &quot;Action&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot; and &quot;Action &gt; 2021&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
        &quot;restrictedValues&quot;: [ # Only get facet for the given restricted values. Only supported on textual fields. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;restricted_values&quot; to &quot;Action &gt; 2022&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
      },
      &quot;limit&quot;: 42, # Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is &quot;healthcare_aggregation_key&quot;, the limit will be overridden to 10,000 internally, regardless of the value set here. If this field is negative, an `INVALID_ARGUMENT` is returned.
    },
  ],
  &quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field &#x27;name&#x27; in their schema. In this case the filter would look like this: filter --&gt; name:&#x27;ANY(&quot;king kong&quot;)&#x27; For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  &quot;imageQuery&quot;: { # Specifies the image query input. # Raw image query.
    &quot;imageBytes&quot;: &quot;A String&quot;, # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP.
  },
  &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). This field helps to better interpret the query. If a value isn&#x27;t specified, the query language code is automatically detected, which may not be accurate.
  &quot;naturalLanguageQueryUnderstandingSpec&quot;: { # Specification to enable natural language understanding capabilities for search requests. # Optional. Config for natural language query understanding capabilities, such as extracting structured field filters from the query. Refer to [this documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) for more information. If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional natural language query understanding will be done.
    &quot;allowedFieldNames&quot;: [ # Optional. Allowlist of fields that can be used for natural language filter extraction. By default, if this is unspecified, all indexable fields are eligible for natural language filter extraction (but are not guaranteed to be used). If any fields are specified in allowed_field_names, only the fields that are both marked as indexable in the schema and specified in the allowlist will be eligible for natural language filter extraction. Note: for multi-datastore search, this is not yet supported, and will be ignored.
      &quot;A String&quot;,
    ],
    &quot;extractedFilterBehavior&quot;: &quot;A String&quot;, # Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is `HARD_FILTER`. For multi-datastore search, the default behavior is `SOFT_BOOST`. Location-based filters are always applied as hard filters, and the `SOFT_BOOST` setting will not affect them. This field is only used if SearchRequest.natural_language_query_understanding_spec.filter_extraction_condition is set to FilterExtractionCondition.ENABLED.
    &quot;filterExtractionCondition&quot;: &quot;A String&quot;, # The condition under which filter extraction should occur. Server behavior defaults to `DISABLED`.
    &quot;geoSearchQueryDetectionFieldNames&quot;: [ # Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to `ENABLED`. If this field is set, it overrides the field names set in ServingConfig.geo_search_query_detection_field_names.
      &quot;A String&quot;,
    ],
  },
  &quot;offset&quot;: 42, # A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned. A large offset may be capped to a reasonable threshold.
  &quot;oneBoxPageSize&quot;: 42, # The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.
  &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. For more information on ordering the website search results, see [Order web search results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). For more information on ordering the healthcare search results, see [Order healthcare search results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
  &quot;pageSize&quot;: 42, # Maximum number of Documents to return. The maximum allowed value depends on the data type. Values above the maximum value are coerced to the maximum value. * Websites with basic indexing: Default `10`, Maximum `25`. * Websites with advanced indexing: Default `25`, Maximum `50`. * Other: Default `50`, Maximum `100`. If this field is negative, an `INVALID_ARGUMENT` is returned.
  &quot;pageToken&quot;: &quot;A String&quot;, # A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.
  &quot;params&quot;: { # Additional search parameters. For public website search only, supported values are: * `user_country_code`: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. For example, `user_country_code: &quot;au&quot;` For available codes see [Country Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * `search_type`: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching. For example, `search_type: 1`
    &quot;a_key&quot;: &quot;&quot;,
  },
  &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
    &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
  },
  &quot;query&quot;: &quot;A String&quot;, # Raw search query.
  &quot;queryExpansionSpec&quot;: { # Specification to determine under which conditions query expansion should occur. # The query expansion specification that specifies the conditions under which query expansion occurs.
    &quot;condition&quot;: &quot;A String&quot;, # The condition under which query expansion should occur. Default to Condition.DISABLED.
    &quot;pinUnexpandedResults&quot;: True or False, # Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.
  },
  &quot;rankingExpression&quot;: &quot;A String&quot;, # Optional. The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The syntax and supported features depend on the `ranking_expression_backend` value. If `ranking_expression_backend` is not provided, it defaults to `RANK_BY_EMBEDDING`. If ranking_expression_backend is not provided or set to `RANK_BY_EMBEDDING`, it should be a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between `embedding_field_path` and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. If ranking_expression_backend is set to `RANK_BY_FORMULA`, the following expression types (and combinations of those chained using + or * operators) are supported: * `double` * `signal` * `log(signal)` * `exp(signal)` * `rr(signal, double &gt; 0)` -- reciprocal rank transformation with second argument being a denominator constant. * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns signal2 | double, else returns signal1. Here are a few examples of ranking formulas that use the supported ranking expression types: - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` -- mostly rank by the logarithm of `keyword_similarity_score` with slight `semantic_smilarity_score` adjustment. - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * is_nan(keyword_similarity_score)` -- rank by the exponent of `semantic_similarity_score` filling the value with 0 if it&#x27;s NaN, also add constant 0.3 adjustment to the final score if `semantic_similarity_score` is NaN. - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank of `keyword_similarity_score` with slight adjustment of reciprocal rank of `semantic_smilarity_score`. The following signals are supported: * `semantic_similarity_score`: semantic similarity adjustment that is calculated using the embeddings generated by a proprietary Google model. This score determines how semantically similar a search query is to a document. * `keyword_similarity_score`: keyword match adjustment uses the Best Match 25 (BM25) ranking function. This score is calculated using a probabilistic model to estimate the probability that a document is relevant to a given query. * `relevance_score`: semantic relevance adjustment that uses a proprietary Google model to determine the meaning and intent behind a user&#x27;s query in context with the content in the documents. * `pctr_rank`: predicted conversion rate adjustment as a rank use predicted Click-through rate (pCTR) to gauge the relevance and attractiveness of a search result from a user&#x27;s perspective. A higher pCTR suggests that the result is more likely to satisfy the user&#x27;s query and intent, making it a valuable signal for ranking. * `freshness_rank`: freshness adjustment as a rank * `document_age`: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes). * `topicality_rank`: topicality adjustment as a rank. Uses proprietary Google model to determine the keyword-based overlap between the query and the document. * `base_rank`: the default rank of the result
  &quot;rankingExpressionBackend&quot;: &quot;A String&quot;, # Optional. The backend to use for the ranking expression evaluation.
  &quot;regionCode&quot;: &quot;A String&quot;, # The Unicode country/region code (CLDR) of a location, such as &quot;US&quot; and &quot;419&quot;. For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). If set, then results will be boosted based on the region_code provided.
  &quot;relevanceScoreSpec&quot;: { # The specification for returning the document relevance score. # Optional. The specification for returning the relevance score.
    &quot;returnRelevanceScore&quot;: True or False, # Optional. Whether to return the relevance score for search results. The higher the score, the more relevant the document is to the query.
  },
  &quot;relevanceThreshold&quot;: &quot;A String&quot;, # The relevance threshold of the search results. Default to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information. This feature is not supported for healthcare search.
  &quot;safeSearch&quot;: True or False, # Whether to turn on safe search. This is only supported for website search.
  &quot;searchAddonSpec&quot;: { # SearchAddonSpec is used to disable add-ons for search as per new repricing model. By default if the SearchAddonSpec is not specified, we consider that the customer wants to enable them wherever applicable. # Optional. SearchAddonSpec is used to disable add-ons for search as per new repricing model. This field is only supported for search requests.
    &quot;disableGenerativeAnswerAddOn&quot;: True or False, # Optional. If true, generative answer add-on is disabled. Generative answer add-on includes natural language to filters and simple answers.
    &quot;disableKpiPersonalizationAddOn&quot;: True or False, # Optional. If true, disables event re-ranking and personalization to optimize KPIs &amp; personalize results.
    &quot;disableSemanticAddOn&quot;: True or False, # Optional. If true, semantic add-on is disabled. Semantic add-on includes embeddings and jetstream.
  },
  &quot;searchAsYouTypeSpec&quot;: { # Specification for search as you type in search requests. # Search as you type configuration. Only supported for the IndustryVertical.MEDIA vertical.
    &quot;condition&quot;: &quot;A String&quot;, # The condition under which search as you type should occur. Default to Condition.DISABLED.
  },
  &quot;servingConfig&quot;: &quot;A String&quot;, # Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.
  &quot;session&quot;: &quot;A String&quot;, # The session resource name. Optional. Session allows users to do multi-turn /search API calls or coordination between /search API calls and /answer API calls. Example #1 (multi-turn /search API calls): Call /search API with the session ID generated in the first call. Here, the previous search query gets considered in query standing. I.e., if the first query is &quot;How did Alphabet do in 2022?&quot; and the current query is &quot;How about 2023?&quot;, the current query will be interpreted as &quot;How did Alphabet do in 2023?&quot;. Example #2 (coordination between /search API calls and /answer API calls): Call /answer API with the session ID generated in the first call. Here, the answer generation happens in the context of the search results from the first search call. Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team.
  &quot;sessionSpec&quot;: { # Session specification. Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team. # Session specification. Can be used only when `session` is set.
    &quot;queryId&quot;: &quot;A String&quot;, # If set, the search result gets stored to the &quot;turn&quot; specified by this query ID. Example: Let&#x27;s say the session looks like this: session { name: &quot;.../sessions/xxx&quot; turns { query { text: &quot;What is foo?&quot; query_id: &quot;.../questions/yyy&quot; } answer: &quot;Foo is ...&quot; } turns { query { text: &quot;How about bar then?&quot; query_id: &quot;.../questions/zzz&quot; } } } The user can call /search API with a request like this: session: &quot;.../sessions/xxx&quot; session_spec { query_id: &quot;.../questions/zzz&quot; } Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID &amp; query ID.
    &quot;searchResultPersistenceCount&quot;: 42, # The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call. This field is similar to the `summary_result_count` field in SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count. At most 10 results for documents mode, or 50 for chunks mode.
  },
  &quot;spellCorrectionSpec&quot;: { # The specification for query spell correction. # The spell correction specification that specifies the mode under which spell correction takes effect.
    &quot;mode&quot;: &quot;A String&quot;, # The mode under which spell correction replaces the original search query. Defaults to Mode.AUTO.
  },
  &quot;useLatestData&quot;: True or False, # Uses the Engine, ServingConfig and Control freshly read from the database. Note: this skips config cache and introduces dependency on databases, which could significantly increase the API latency. It should only be used for testing, but not serving end users.
  &quot;userInfo&quot;: { # Information of an end user. # Information about the end user. Highly recommended for analytics and personalization. UserInfo.user_agent is used to deduce `device_type` for analytics.
    &quot;timeZone&quot;: &quot;A String&quot;, # Optional. IANA time zone, e.g. Europe/Budapest.
    &quot;userAgent&quot;: &quot;A String&quot;, # User agent as included in the HTTP header. The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.
    &quot;userId&quot;: &quot;A String&quot;, # Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don&#x27;t set for anonymous users. Always use a hashed value for this ID. Don&#x27;t set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
  },
  &quot;userLabels&quot;: { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;userPseudoId&quot;: &quot;A String&quot;, # Optional. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for SearchService.Search method.
  &quot;appliedControls&quot;: [ # Controls applied as part of the Control service.
    &quot;A String&quot;,
  ],
  &quot;attributionToken&quot;: &quot;A String&quot;, # A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.
  &quot;correctedQuery&quot;: &quot;A String&quot;, # Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.
  &quot;facets&quot;: [ # Results of facets requested by user.
    { # A facet result.
      &quot;dynamicFacet&quot;: True or False, # Whether the facet is dynamically generated.
      &quot;key&quot;: &quot;A String&quot;, # The key for this facet. For example, `&quot;colors&quot;` or `&quot;price&quot;`. It matches SearchRequest.FacetSpec.FacetKey.key.
      &quot;values&quot;: [ # The facet values for this field.
        { # A facet value which contains value names and their count.
          &quot;count&quot;: &quot;A String&quot;, # Number of items that have this facet value.
          &quot;interval&quot;: { # A floating point interval. # Interval value for a facet, such as 10, 20) for facet &quot;price&quot;. It matches [SearchRequest.FacetSpec.FacetKey.intervals.
            &quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
            &quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
            &quot;maximum&quot;: 3.14, # Inclusive upper bound.
            &quot;minimum&quot;: 3.14, # Inclusive lower bound.
          },
          &quot;value&quot;: &quot;A String&quot;, # Text value of a facet, such as &quot;Black&quot; for facet &quot;colors&quot;.
        },
      ],
    },
  ],
  &quot;geoSearchDebugInfo&quot;: [
    { # Debug information specifically related to forward geocoding issues arising from Geolocation Search.
      &quot;errorMessage&quot;: &quot;A String&quot;, # The error produced.
      &quot;originalAddressQuery&quot;: &quot;A String&quot;, # The address from which forward geocoding ingestion produced issues.
    },
  ],
  &quot;guidedSearchResult&quot;: { # Guided search result. The guided search helps user to refine the search results and narrow down to the real needs from a broaded search results. # Guided search result.
    &quot;followUpQuestions&quot;: [ # Suggested follow-up questions.
      &quot;A String&quot;,
    ],
    &quot;refinementAttributes&quot;: [ # A list of ranked refinement attributes.
      { # Useful attribute for search result refinements.
        &quot;attributeKey&quot;: &quot;A String&quot;, # Attribute key used to refine the results. For example, `&quot;movie_type&quot;`.
        &quot;attributeValue&quot;: &quot;A String&quot;, # Attribute value used to refine the results. For example, `&quot;drama&quot;`.
      },
    ],
  },
  &quot;naturalLanguageQueryUnderstandingInfo&quot;: { # Information describing what natural language understanding was done on the input query. # Natural language query understanding information for the returned results.
    &quot;classifiedIntents&quot;: [ # The classified intents from the input query.
      &quot;A String&quot;,
    ],
    &quot;extractedFilters&quot;: &quot;A String&quot;, # The filters that were extracted from the input query.
    &quot;rewrittenQuery&quot;: &quot;A String&quot;, # Rewritten input query minus the extracted filters.
    &quot;structuredExtractedFilter&quot;: { # The filters that were extracted from the input query represented in a structured form. # The filters that were extracted from the input query represented in a structured form.
      &quot;expression&quot;: { # The expression denoting the filter that was extracted from the input query. # The expression denoting the filter that was extracted from the input query in a structured form. It can be a simple expression denoting a single string, numerical or geolocation constraint or a compound expression which is a combination of multiple expressions connected using logical (OR and AND) operators.
        &quot;andExpr&quot;: { # Logical `And` operator. # Logical &quot;And&quot; compound operator connecting multiple expressions.
          &quot;expressions&quot;: [ # The expressions that were ANDed together.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaSearchResponseNaturalLanguageQueryUnderstandingInfoStructuredExtractedFilterExpression
          ],
        },
        &quot;geolocationConstraint&quot;: { # Constraint of a geolocation field. Name of the geolocation field as defined in the schema. # Geolocation constraint expression.
          &quot;address&quot;: &quot;A String&quot;, # The reference address that was inferred from the input query. The proximity of the reference address to the geolocation field will be used to filter the results.
          &quot;fieldName&quot;: &quot;A String&quot;, # The name of the geolocation field as defined in the schema.
          &quot;latitude&quot;: 3.14, # The latitude of the geolocation inferred from the input query.
          &quot;longitude&quot;: 3.14, # The longitude of the geolocation inferred from the input query.
          &quot;radiusInMeters&quot;: 3.14, # The radius in meters around the address. The record is returned if the location of the geolocation field is within the radius.
        },
        &quot;numberConstraint&quot;: { # Constraint expression of a number field. Example: price &lt; 100. # Numerical constraint expression.
          &quot;comparison&quot;: &quot;A String&quot;, # The comparison operation performed between the field value and the value specified in the constraint.
          &quot;fieldName&quot;: &quot;A String&quot;, # Name of the numerical field as defined in the schema.
          &quot;querySegment&quot;: &quot;A String&quot;, # Identifies the keywords within the search query that match a filter.
          &quot;value&quot;: 3.14, # The value specified in the numerical constraint.
        },
        &quot;orExpr&quot;: { # Logical `Or` operator. # Logical &quot;Or&quot; compound operator connecting multiple expressions.
          &quot;expressions&quot;: [ # The expressions that were ORed together.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaSearchResponseNaturalLanguageQueryUnderstandingInfoStructuredExtractedFilterExpression
          ],
        },
        &quot;stringConstraint&quot;: { # Constraint expression of a string field. # String constraint expression.
          &quot;fieldName&quot;: &quot;A String&quot;, # Name of the string field as defined in the schema.
          &quot;querySegment&quot;: &quot;A String&quot;, # Identifies the keywords within the search query that match a filter.
          &quot;values&quot;: [ # Values of the string field. The record will only be returned if the field value matches one of the values specified here.
            &quot;A String&quot;,
          ],
        },
      },
    },
  },
  &quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
  &quot;oneBoxResults&quot;: [ # A list of One Box results. There can be multiple One Box results of different types.
    { # OneBoxResult is a holder for all results of specific type that we want to display in UI differently.
      &quot;oneBoxType&quot;: &quot;A String&quot;, # The type of One Box result.
      &quot;searchResults&quot;: [ # The search results for this One Box.
        { # Represents the search results.
          &quot;chunk&quot;: { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode. # The chunk data in the search response if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
            &quot;annotationContents&quot;: [ # Output only. Annotation contents if the current chunk contains annotations.
              &quot;A String&quot;,
            ],
            &quot;annotationMetadata&quot;: [ # Output only. The annotation metadata includes structured content in the current chunk.
              { # The annotation metadata includes structured content in the current chunk.
                &quot;imageId&quot;: &quot;A String&quot;, # Output only. Image id is provided if the structured content is based on an image.
                &quot;structuredContent&quot;: { # The structured content information. # Output only. The structured content information.
                  &quot;content&quot;: &quot;A String&quot;, # Output only. The content of the structured content.
                  &quot;structureType&quot;: &quot;A String&quot;, # Output only. The structure type of the structured content.
                },
              },
            ],
            &quot;chunkMetadata&quot;: { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
              &quot;nextChunks&quot;: [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
                # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
              ],
              &quot;previousChunks&quot;: [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
                # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
              ],
            },
            &quot;content&quot;: &quot;A String&quot;, # Content is a string from a document (parsed content).
            &quot;dataUrls&quot;: [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
              &quot;A String&quot;,
            ],
            &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
              &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
              &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
              &quot;title&quot;: &quot;A String&quot;, # Title of the document.
              &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
            },
            &quot;id&quot;: &quot;A String&quot;, # Unique chunk ID of the current chunk.
            &quot;name&quot;: &quot;A String&quot;, # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
            &quot;pageSpan&quot;: { # Page span of the chunk. # Page span of the chunk.
              &quot;pageEnd&quot;: 42, # The end page of the chunk.
              &quot;pageStart&quot;: 42, # The start page of the chunk.
            },
            &quot;relevanceScore&quot;: 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
          },
          &quot;document&quot;: { # Document captures all raw metadata information of items to be recommended or searched. # The document data snippet in the search response. Only fields that are marked as `retrievable` are populated.
            &quot;aclInfo&quot;: { # ACL Information of the Document. # Access control information for the document.
              &quot;readers&quot;: [ # Readers of the document.
                { # AclRestriction to model complex inheritance restrictions. Example: Modeling a &quot;Both Permit&quot; inheritance, where to access a child document, user needs to have access to parent document. Document Hierarchy - Space_S --&gt; Page_P. Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2 Space_S ACL Restriction - { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ] } ] } } Page_P ACL Restriction. { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_2&quot; }, { &quot;group_id&quot;: &quot;group_3&quot; }, { &quot;user_id&quot;: &quot;user_2&quot; } ], }, { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ], } ] } }
                  &quot;idpWide&quot;: True or False, # All users within the Identity Provider.
                  &quot;principals&quot;: [ # List of principals.
                    { # Principal identifier of a user or a group.
                      &quot;externalEntityId&quot;: &quot;A String&quot;, # For 3P application identities which are not present in the customer identity provider.
                      &quot;groupId&quot;: &quot;A String&quot;, # Group identifier. For Google Workspace user account, group_id should be the google workspace group email. For non-google identity provider user account, group_id is the mapped group identifier configured during the workforcepool config.
                      &quot;userId&quot;: &quot;A String&quot;, # User identifier. For Google Workspace user account, user_id should be the google workspace user email. For non-google identity provider user account, user_id is the mapped user identifier configured during the workforcepool config.
                    },
                  ],
                },
              ],
            },
            &quot;content&quot;: { # Unstructured data linked to this document. # The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
              &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `text/plain` (TXT) * `application/xml` or `text/xml` (XML) * `application/json` (JSON) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: * `image/bmp` (BMP) * `image/gif` (GIF) * `image/jpeg` (JPEG) * `image/png` (PNG) * `image/tiff` (TIFF) See https://www.iana.org/assignments/media-types/media-types.xhtml.
              &quot;rawBytes&quot;: &quot;A String&quot;, # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&amp;()&#x27;-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.
            },
            &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;id&quot;: &quot;A String&quot;, # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters.
            &quot;indexStatus&quot;: { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document&#x27;s index is in progress, the pending_message field is populated.
              &quot;errorSamples&quot;: [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
                { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
                  &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
                  &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                    {
                      &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                    },
                  ],
                  &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
                },
              ],
              &quot;indexTime&quot;: &quot;A String&quot;, # The time when the document was indexed. If this field is populated, it means the document has been indexed.
              &quot;pendingMessage&quot;: &quot;A String&quot;, # Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
            },
            &quot;indexTime&quot;: &quot;A String&quot;, # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
            &quot;jsonData&quot;: &quot;A String&quot;, # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
            &quot;name&quot;: &quot;A String&quot;, # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
            &quot;parentDocumentId&quot;: &quot;A String&quot;, # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
            &quot;schemaId&quot;: &quot;A String&quot;, # The identifier of the schema located in the same data store.
            &quot;structData&quot;: { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;id&quot;: &quot;A String&quot;, # Document.id of the searched Document.
          &quot;modelScores&quot;: { # Output only. Google provided available scores.
            &quot;a_key&quot;: { # Double list.
              &quot;values&quot;: [ # Double values.
                3.14,
              ],
            },
          },
          &quot;rankSignals&quot;: { # A set of ranking signals. # Optional. A set of ranking signals associated with the result.
            &quot;boostingFactor&quot;: 3.14, # Optional. Combined custom boosts for a doc.
            &quot;customSignals&quot;: [ # Optional. A list of custom clearbox signals.
              { # Custom clearbox signal represented by name and value pair.
                &quot;name&quot;: &quot;A String&quot;, # Optional. Name of the signal.
                &quot;value&quot;: 3.14, # Optional. Float value representing the ranking signal (e.g. 1.25 for BM25).
              },
            ],
            &quot;defaultRank&quot;: 3.14, # Optional. The default rank of the result.
            &quot;documentAge&quot;: 3.14, # Optional. Age of the document in hours.
            &quot;keywordSimilarityScore&quot;: 3.14, # Optional. Keyword matching adjustment.
            &quot;pctrRank&quot;: 3.14, # Optional. Predicted conversion rate adjustment as a rank.
            &quot;relevanceScore&quot;: 3.14, # Optional. Semantic relevance adjustment.
            &quot;semanticSimilarityScore&quot;: 3.14, # Optional. Semantic similarity adjustment.
            &quot;topicalityRank&quot;: 3.14, # Optional. Topicality adjustment as a rank.
          },
        },
      ],
    },
  ],
  &quot;queryExpansionInfo&quot;: { # Information describing query expansion including whether expansion has occurred. # Query expansion information for the returned results.
    &quot;expandedQuery&quot;: True or False, # Bool describing whether query expansion has occurred.
    &quot;pinnedResultCount&quot;: &quot;A String&quot;, # Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.
  },
  &quot;redirectUri&quot;: &quot;A String&quot;, # The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.
  &quot;results&quot;: [ # A list of matched documents. The order represents the ranking.
    { # Represents the search results.
      &quot;chunk&quot;: { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode. # The chunk data in the search response if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
        &quot;annotationContents&quot;: [ # Output only. Annotation contents if the current chunk contains annotations.
          &quot;A String&quot;,
        ],
        &quot;annotationMetadata&quot;: [ # Output only. The annotation metadata includes structured content in the current chunk.
          { # The annotation metadata includes structured content in the current chunk.
            &quot;imageId&quot;: &quot;A String&quot;, # Output only. Image id is provided if the structured content is based on an image.
            &quot;structuredContent&quot;: { # The structured content information. # Output only. The structured content information.
              &quot;content&quot;: &quot;A String&quot;, # Output only. The content of the structured content.
              &quot;structureType&quot;: &quot;A String&quot;, # Output only. The structure type of the structured content.
            },
          },
        ],
        &quot;chunkMetadata&quot;: { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
          &quot;nextChunks&quot;: [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
          ],
          &quot;previousChunks&quot;: [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
          ],
        },
        &quot;content&quot;: &quot;A String&quot;, # Content is a string from a document (parsed content).
        &quot;dataUrls&quot;: [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
          &quot;A String&quot;,
        ],
        &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
          &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
          &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
        },
        &quot;id&quot;: &quot;A String&quot;, # Unique chunk ID of the current chunk.
        &quot;name&quot;: &quot;A String&quot;, # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
        &quot;pageSpan&quot;: { # Page span of the chunk. # Page span of the chunk.
          &quot;pageEnd&quot;: 42, # The end page of the chunk.
          &quot;pageStart&quot;: 42, # The start page of the chunk.
        },
        &quot;relevanceScore&quot;: 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
      },
      &quot;document&quot;: { # Document captures all raw metadata information of items to be recommended or searched. # The document data snippet in the search response. Only fields that are marked as `retrievable` are populated.
        &quot;aclInfo&quot;: { # ACL Information of the Document. # Access control information for the document.
          &quot;readers&quot;: [ # Readers of the document.
            { # AclRestriction to model complex inheritance restrictions. Example: Modeling a &quot;Both Permit&quot; inheritance, where to access a child document, user needs to have access to parent document. Document Hierarchy - Space_S --&gt; Page_P. Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2 Space_S ACL Restriction - { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ] } ] } } Page_P ACL Restriction. { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_2&quot; }, { &quot;group_id&quot;: &quot;group_3&quot; }, { &quot;user_id&quot;: &quot;user_2&quot; } ], }, { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ], } ] } }
              &quot;idpWide&quot;: True or False, # All users within the Identity Provider.
              &quot;principals&quot;: [ # List of principals.
                { # Principal identifier of a user or a group.
                  &quot;externalEntityId&quot;: &quot;A String&quot;, # For 3P application identities which are not present in the customer identity provider.
                  &quot;groupId&quot;: &quot;A String&quot;, # Group identifier. For Google Workspace user account, group_id should be the google workspace group email. For non-google identity provider user account, group_id is the mapped group identifier configured during the workforcepool config.
                  &quot;userId&quot;: &quot;A String&quot;, # User identifier. For Google Workspace user account, user_id should be the google workspace user email. For non-google identity provider user account, user_id is the mapped user identifier configured during the workforcepool config.
                },
              ],
            },
          ],
        },
        &quot;content&quot;: { # Unstructured data linked to this document. # The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
          &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `text/plain` (TXT) * `application/xml` or `text/xml` (XML) * `application/json` (JSON) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: * `image/bmp` (BMP) * `image/gif` (GIF) * `image/jpeg` (JPEG) * `image/png` (PNG) * `image/tiff` (TIFF) See https://www.iana.org/assignments/media-types/media-types.xhtml.
          &quot;rawBytes&quot;: &quot;A String&quot;, # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&amp;()&#x27;-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.
          &quot;uri&quot;: &quot;A String&quot;, # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.
        },
        &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;id&quot;: &quot;A String&quot;, # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters.
        &quot;indexStatus&quot;: { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document&#x27;s index is in progress, the pending_message field is populated.
          &quot;errorSamples&quot;: [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
            { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
              &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
              &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                {
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                },
              ],
              &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
            },
          ],
          &quot;indexTime&quot;: &quot;A String&quot;, # The time when the document was indexed. If this field is populated, it means the document has been indexed.
          &quot;pendingMessage&quot;: &quot;A String&quot;, # Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
        },
        &quot;indexTime&quot;: &quot;A String&quot;, # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
        &quot;jsonData&quot;: &quot;A String&quot;, # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
        &quot;name&quot;: &quot;A String&quot;, # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
        &quot;parentDocumentId&quot;: &quot;A String&quot;, # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
        &quot;schemaId&quot;: &quot;A String&quot;, # The identifier of the schema located in the same data store.
        &quot;structData&quot;: { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
      },
      &quot;id&quot;: &quot;A String&quot;, # Document.id of the searched Document.
      &quot;modelScores&quot;: { # Output only. Google provided available scores.
        &quot;a_key&quot;: { # Double list.
          &quot;values&quot;: [ # Double values.
            3.14,
          ],
        },
      },
      &quot;rankSignals&quot;: { # A set of ranking signals. # Optional. A set of ranking signals associated with the result.
        &quot;boostingFactor&quot;: 3.14, # Optional. Combined custom boosts for a doc.
        &quot;customSignals&quot;: [ # Optional. A list of custom clearbox signals.
          { # Custom clearbox signal represented by name and value pair.
            &quot;name&quot;: &quot;A String&quot;, # Optional. Name of the signal.
            &quot;value&quot;: 3.14, # Optional. Float value representing the ranking signal (e.g. 1.25 for BM25).
          },
        ],
        &quot;defaultRank&quot;: 3.14, # Optional. The default rank of the result.
        &quot;documentAge&quot;: 3.14, # Optional. Age of the document in hours.
        &quot;keywordSimilarityScore&quot;: 3.14, # Optional. Keyword matching adjustment.
        &quot;pctrRank&quot;: 3.14, # Optional. Predicted conversion rate adjustment as a rank.
        &quot;relevanceScore&quot;: 3.14, # Optional. Semantic relevance adjustment.
        &quot;semanticSimilarityScore&quot;: 3.14, # Optional. Semantic similarity adjustment.
        &quot;topicalityRank&quot;: 3.14, # Optional. Topicality adjustment as a rank.
      },
    },
  ],
  &quot;searchLinkPromotions&quot;: [ # Promotions for site search.
    { # Promotion proto includes uri and other helping information to display the promotion.
      &quot;description&quot;: &quot;A String&quot;, # Optional. The Promotion description. Maximum length: 200 characters.
      &quot;document&quot;: &quot;A String&quot;, # Optional. The Document the user wants to promote. For site search, leave unset and only populate uri. Can be set along with uri.
      &quot;enabled&quot;: True or False, # Optional. The enabled promotion will be returned for any serving configs associated with the parent of the control this promotion is attached to. This flag is used for basic site search only.
      &quot;imageUri&quot;: &quot;A String&quot;, # Optional. The promotion thumbnail image url.
      &quot;title&quot;: &quot;A String&quot;, # Required. The title of the promotion. Maximum length: 160 characters.
      &quot;uri&quot;: &quot;A String&quot;, # Optional. The URL for the page the user wants to promote. Must be set for site search. For other verticals, this is optional.
    },
  ],
  &quot;sessionInfo&quot;: { # Information about the session. # Session information. Only set if SearchRequest.session is provided. See its description for more details.
    &quot;name&quot;: &quot;A String&quot;, # Name of the session. If the auto-session mode is used (when SearchRequest.session ends with &quot;-&quot;), this field holds the newly generated session name.
    &quot;queryId&quot;: &quot;A String&quot;, # Query ID that corresponds to this search API call. One session can have multiple turns, each with a unique query ID. By specifying the session name and this query ID in the Answer API call, the answer generation happens in the context of the search results from this search call.
  },
  &quot;suggestedQuery&quot;: &quot;A String&quot;, # Corrected query with low confidence, AKA did you mean query. Compared with corrected_query, this field is set when SpellCorrector returned a response, but FPR(full page replacement) is not triggered because the corrction is of low confidence(eg, reversed because there are matches of the original query in document corpus).
  &quot;summary&quot;: { # Summary of the top N search results specified by the summary spec. # A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.
    &quot;safetyAttributes&quot;: { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores.
      &quot;categories&quot;: [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores.
        &quot;A String&quot;,
      ],
      &quot;scores&quot;: [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories.
        3.14,
      ],
    },
    &quot;summarySkippedReasons&quot;: [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
      &quot;A String&quot;,
    ],
    &quot;summaryText&quot;: &quot;A String&quot;, # The summary content.
    &quot;summaryWithMetadata&quot;: { # Summary with metadata information. # Summary with metadata information.
      &quot;blobAttachments&quot;: [ # Output only. Store multimodal data for answer enhancement.
        { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
          &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
          &quot;data&quot;: { # Stores type and data of the blob. # Output only. The blob data.
            &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
            &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated data.
          },
        },
      ],
      &quot;citationMetadata&quot;: { # Citation metadata. # Citation metadata for given summary.
        &quot;citations&quot;: [ # Citations for segments.
          { # Citation info for a segment.
            &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive.
            &quot;sources&quot;: [ # Citation sources for the attributed segment.
              { # Citation source.
                &quot;referenceIndex&quot;: &quot;A String&quot;, # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly.
              },
            ],
            &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes/unicode.
          },
        ],
      },
      &quot;references&quot;: [ # Document References.
        { # Document reference.
          &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
            { # Chunk content.
              &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                &quot;A String&quot;,
              ],
              &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
              &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
            },
          ],
          &quot;document&quot;: &quot;A String&quot;, # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
          &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Cloud Storage or HTTP uri for the document.
        },
      ],
      &quot;summary&quot;: &quot;A String&quot;, # Summary text with no citation information.
    },
  },
  &quot;totalSize&quot;: 42, # The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.
}</pre>
</div>

<div class="method">
    <code class="details" id="searchLite">searchLite(servingConfig, body=None, x__xgafv=None)</code>
  <pre>Performs a search. Similar to the SearchService.Search method, but a lite version that allows API key for authentication, where OAuth and IAM checks are not required. Only public website search is supported by this method. If data stores and engines not associated with public website search are specified, a `FAILED_PRECONDITION` error is returned. This method can be used for easy onboarding without having to implement an authentication backend. However, it is strongly recommended to use SearchService.Search instead with required OAuth and IAM checks to provide better data security.

Args:
  servingConfig: string, Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for SearchService.Search method.
  &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
    &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
      { # Boost applies to documents which match a condition.
        &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
        &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
          &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
          &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
            { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
              &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
              &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
            },
          ],
          &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
          &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
        },
        &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
      },
    ],
  },
  &quot;branch&quot;: &quot;A String&quot;, # The branch resource name, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`. Use `default_branch` as the branch ID or leave this field empty, to search documents under the default branch.
  &quot;canonicalFilter&quot;: &quot;A String&quot;, # The default filter that is applied when a user performs a search without checking any filters on the search page. The filter applied to every search request when quality improvement such as query expansion is needed. In the case a query does not have a sufficient amount of results this filter will be used to determine whether or not to enable the query expansion flow. The original filter will still be used for the query expanded search. This field is strongly recommended to achieve high search quality. For more information about filter syntax, see SearchRequest.filter.
  &quot;contentSearchSpec&quot;: { # A specification for configuring the behavior of content search. # A specification for configuring the behavior of content search.
    &quot;chunkSpec&quot;: { # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS # Specifies the chunk spec to be returned from the search response. Only available if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS
      &quot;numNextChunks&quot;: 42, # The number of next chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no next chunks will be returned.
      &quot;numPreviousChunks&quot;: 42, # The number of previous chunks to be returned of the current chunk. The maximum allowed value is 3. If not specified, no previous chunks will be returned.
    },
    &quot;extractiveContentSpec&quot;: { # A specification for configuring the extractive content in a search response. # If there is no extractive_content_spec provided, there will be no extractive answer in the search response.
      &quot;maxExtractiveAnswerCount&quot;: 42, # The maximum number of extractive answers returned in each search result. An extractive answer is a verbatim answer extracted from the original document, which provides a precise and contextually relevant answer to the search query. If the number of matching answers is less than the `max_extractive_answer_count`, return all of the answers. Otherwise, return the `max_extractive_answer_count`. At most five answers are returned for each SearchResult.
      &quot;maxExtractiveSegmentCount&quot;: 42, # The max number of extractive segments returned in each search result. Only applied if the DataStore is set to DataStore.ContentConfig.CONTENT_REQUIRED or DataStore.solution_types is SOLUTION_TYPE_CHAT. An extractive segment is a text segment extracted from the original document that is relevant to the search query, and, in general, more verbose than an extractive answer. The segment could then be used as input for LLMs to generate summaries and answers. If the number of matching segments is less than `max_extractive_segment_count`, return all of the segments. Otherwise, return the `max_extractive_segment_count`.
      &quot;numNextSegments&quot;: 42, # Return at most `num_next_segments` segments after each selected segments.
      &quot;numPreviousSegments&quot;: 42, # Specifies whether to also include the adjacent from each selected segments. Return at most `num_previous_segments` segments before each selected segments.
      &quot;returnExtractiveSegmentScore&quot;: True or False, # Specifies whether to return the confidence score from the extractive segments in each search result. This feature is available only for new or allowlisted data stores. To allowlist your data store, contact your Customer Engineer. The default value is `false`.
    },
    &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`.
    &quot;snippetSpec&quot;: { # A specification for configuring snippets in a search response. # If `snippetSpec` is not specified, snippets are not included in the search response.
      &quot;maxSnippetCount&quot;: 42, # [DEPRECATED] This field is deprecated. To control snippet return, use `return_snippet` field. For backwards compatibility, we will return snippet if max_snippet_count &gt; 0.
      &quot;referenceOnly&quot;: True or False, # [DEPRECATED] This field is deprecated and will have no affect on the snippet.
      &quot;returnSnippet&quot;: True or False, # If `true`, then return snippet. If no snippet can be generated, we return &quot;No snippet is available for this page.&quot; A `snippet_status` with `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
    },
    &quot;summarySpec&quot;: { # A specification for configuring a summary returned in a search response. # If `summarySpec` is not specified, summaries are not included in the search response.
      &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No summary is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating summaries for adversarial queries and return fallback messages instead.
      &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
      &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. The default value is `false`. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true`, only queries with high relevance search results will generate answers.
      &quot;ignoreNonSummarySeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not summary-seeking. The default value is `false`. Google employs search-query classification to detect summary-seeking queries. No summary is returned if the search query is classified as a non-summary seeking query. For example, `why is the sky blue` and `Who is the best soccer player in the world?` are summary-seeking queries, but `SFO airport` and `world cup 2026` are not. They are most likely navigational queries. If this field is set to `true`, we skip generating summaries for non-summary seeking queries and return fallback messages instead.
      &quot;includeCitations&quot;: True or False, # Specifies whether to include citations in the summary. The default value is `false`. When this field is set to `true`, summaries include in-line citation numbers. Example summary including citations: BigQuery is Google Cloud&#x27;s fully managed and completely serverless enterprise data warehouse [1]. BigQuery supports all data types, works across clouds, and has built-in machine learning and business intelligence, all within a unified platform [2, 3]. The citation numbers refer to the returned search results and are 1-indexed. For example, [1] means that the sentence is attributed to the first search result. [2, 3] means that the sentence is attributed to both the second and third search results.
      &quot;languageCode&quot;: &quot;A String&quot;, # Language code for Summary. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
      &quot;modelPromptSpec&quot;: { # Specification of the prompt to use with the model. # If specified, the spec will be used to modify the prompt provided to the LLM.
        &quot;preamble&quot;: &quot;A String&quot;, # Text at the beginning of the prompt that instructs the assistant. Examples are available in the user guide.
      },
      &quot;modelSpec&quot;: { # Specification of the model. # If specified, the spec will be used to modify the model specification provided to the LLM.
        &quot;version&quot;: &quot;A String&quot;, # The model version used to generate the summary. Supported values are: * `stable`: string. Default value when no value is specified. Uses a generally available, fine-tuned model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models). * `preview`: string. (Public preview) Uses a preview model. For more information, see [Answer generation model versions and lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
      },
      &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
        &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
      },
      &quot;summaryResultCount&quot;: 42, # The number of top results to generate the summary from. If the number of results returned is less than `summaryResultCount`, the summary is generated from all of the results. At most 10 results for documents mode, or 50 for chunks mode, can be used to generate a summary. The chunks mode is used when SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
      &quot;useSemanticChunks&quot;: True or False, # If true, answer will be generated from most relevant chunks from top search results. This feature will improve summary quality. Note that with this feature enabled, not all top search results will be referenced and included in the reference list, so the citation source index only points to the search results listed in the reference list.
    },
  },
  &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs. If set, it has higher priority than the configs set in ServingConfig.custom_fine_tuning_spec.
    &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
  },
  &quot;dataStoreSpecs&quot;: [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. For engines with a single data store, the specs directly under SearchRequest should be used.
    { # A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error is returned.
      &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Optional. Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
        &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
          { # Boost applies to documents which match a condition.
            &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
            &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
              &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
              &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                  &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                  &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                },
              ],
              &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
              &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
            },
            &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
          },
        ],
      },
      &quot;customSearchOperators&quot;: &quot;A String&quot;, # Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
      &quot;dataStore&quot;: &quot;A String&quot;, # Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. The path must include the project number, project id is not supported for this field.
      &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    },
  ],
  &quot;displaySpec&quot;: { # Specifies features for display, like match highlighting. # Optional. Config for display feature, like match highlighting on search results.
    &quot;matchHighlightingCondition&quot;: &quot;A String&quot;, # The condition under which match highlighting should occur.
  },
  &quot;embeddingSpec&quot;: { # The specification that uses customized query embedding vector to do semantic document retrieval. # Uses the provided embedding to do additional semantic document retrieval. The retrieval is based on the dot product of SearchRequest.EmbeddingSpec.EmbeddingVector.vector and the document embedding that is provided in SearchRequest.EmbeddingSpec.EmbeddingVector.field_path. If SearchRequest.EmbeddingSpec.EmbeddingVector.field_path is not provided, it will use ServingConfig.EmbeddingConfig.field_path.
    &quot;embeddingVectors&quot;: [ # The embedding vector used for retrieval. Limit to 1.
      { # Embedding vector.
        &quot;fieldPath&quot;: &quot;A String&quot;, # Embedding field path in schema.
        &quot;vector&quot;: [ # Query embedding vector.
          3.14,
        ],
      },
    ],
  },
  &quot;facetSpecs&quot;: [ # Facet specifications for faceted search. If empty, no facets are returned. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
    { # A facet specification to perform faceted search.
      &quot;enableDynamicPosition&quot;: True or False, # Enables dynamic position for this facet. If set to true, the position of this facet among all facets in the response is determined automatically. If dynamic facets are enabled, it is ordered together. If set to false, the position of this facet in the response is the same as in the request, and it is ranked before the facets with dynamic position enable and all dynamic facets. For example, you may always want to have rating facet returned in the response, but it&#x27;s not necessarily to always display the rating facet at the top. In that case, you can set enable_dynamic_position to true so that the position of rating facet in response is determined automatically. Another example, assuming you have the following facets in the request: * &quot;rating&quot;, enable_dynamic_position = true * &quot;price&quot;, enable_dynamic_position = false * &quot;brands&quot;, enable_dynamic_position = false And also you have a dynamic facets enabled, which generates a facet `gender`. Then the final order of the facets in the response can be (&quot;price&quot;, &quot;brands&quot;, &quot;rating&quot;, &quot;gender&quot;) or (&quot;price&quot;, &quot;brands&quot;, &quot;gender&quot;, &quot;rating&quot;) depends on how API orders &quot;gender&quot; and &quot;rating&quot; facets. However, notice that &quot;price&quot; and &quot;brands&quot; are always ranked at first and second position because their enable_dynamic_position is false.
      &quot;excludedFilterKeys&quot;: [ # List of keys to exclude when faceting. By default, FacetKey.key is not excluded from the filter unless it is listed in this field. Listing a facet key in this field allows its values to appear as facet results, even when they are filtered out of search results. Using this field does not affect what search results are returned. For example, suppose there are 100 documents with the color facet &quot;Red&quot; and 200 documents with the color facet &quot;Blue&quot;. A query containing the filter &quot;color:ANY(&quot;Red&quot;)&quot; and having &quot;color&quot; as FacetKey.key would by default return only &quot;Red&quot; documents in the search results, and also return &quot;Red&quot; with count 100 as the only color facet. Although there are also blue documents available, &quot;Blue&quot; would not be shown as an available facet value. If &quot;color&quot; is listed in &quot;excludedFilterKeys&quot;, then the query returns the facet values &quot;Red&quot; with count 100 and &quot;Blue&quot; with count 200, because the &quot;color&quot; key is now excluded from the filter. Because this field doesn&#x27;t affect search results, the search results are still correctly filtered to return only &quot;Red&quot; documents. A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
        &quot;A String&quot;,
      ],
      &quot;facetKey&quot;: { # Specifies how a facet is computed. # Required. The facet key specification.
        &quot;caseInsensitive&quot;: True or False, # True to make facet keys case insensitive when getting faceting values with prefixes or contains; false otherwise.
        &quot;contains&quot;: [ # Only get facet values that contain the given strings. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;contains&quot; to &quot;2022&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot; and &quot;Sci-Fi &gt; 2022&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
        &quot;intervals&quot;: [ # Set only if values should be bucketed into intervals. Must be set for facets with numerical values. Must not be set for facet with text values. Maximum number of intervals is 30.
          { # A floating point interval.
            &quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
            &quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
            &quot;maximum&quot;: 3.14, # Inclusive upper bound.
            &quot;minimum&quot;: 3.14, # Inclusive lower bound.
          },
        ],
        &quot;key&quot;: &quot;A String&quot;, # Required. Supported textual and numerical facet keys in Document object, over which the facet values are computed. Facet key is case-sensitive.
        &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Allowed values are: * &quot;count desc&quot;, which means order by SearchResponse.Facet.values.count descending. * &quot;value desc&quot;, which means order by SearchResponse.Facet.values.value descending. Only applies to textual facets. If not set, textual values are sorted in [natural order](https://en.wikipedia.org/wiki/Natural_sort_order); numerical intervals are sorted in the order given by FacetSpec.FacetKey.intervals.
        &quot;prefixes&quot;: [ # Only get facet values that start with the given string prefix. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;prefixes&quot; to &quot;Action&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot; and &quot;Action &gt; 2021&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
        &quot;restrictedValues&quot;: [ # Only get facet for the given restricted values. Only supported on textual fields. For example, suppose &quot;category&quot; has three values &quot;Action &gt; 2022&quot;, &quot;Action &gt; 2021&quot; and &quot;Sci-Fi &gt; 2022&quot;. If set &quot;restricted_values&quot; to &quot;Action &gt; 2022&quot;, the &quot;category&quot; facet only contains &quot;Action &gt; 2022&quot;. Only supported on textual fields. Maximum is 10.
          &quot;A String&quot;,
        ],
      },
      &quot;limit&quot;: 42, # Maximum facet values that are returned for this facet. If unspecified, defaults to 20. The maximum allowed value is 300. Values above 300 are coerced to 300. For aggregation in healthcare search, when the [FacetKey.key] is &quot;healthcare_aggregation_key&quot;, the limit will be overridden to 10,000 internally, regardless of the value set here. If this field is negative, an `INVALID_ARGUMENT` is returned.
    },
  ],
  &quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customer might have a field &#x27;name&#x27; in their schema. In this case the filter would look like this: filter --&gt; name:&#x27;ANY(&quot;king kong&quot;)&#x27; For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
  &quot;imageQuery&quot;: { # Specifies the image query input. # Raw image query.
    &quot;imageBytes&quot;: &quot;A String&quot;, # Base64 encoded image bytes. Supported image formats: JPEG, PNG, and BMP.
  },
  &quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as &quot;en-US&quot; or &quot;sr-Latn&quot;. For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). This field helps to better interpret the query. If a value isn&#x27;t specified, the query language code is automatically detected, which may not be accurate.
  &quot;naturalLanguageQueryUnderstandingSpec&quot;: { # Specification to enable natural language understanding capabilities for search requests. # Optional. Config for natural language query understanding capabilities, such as extracting structured field filters from the query. Refer to [this documentation](https://cloud.google.com/generative-ai-app-builder/docs/natural-language-queries) for more information. If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional natural language query understanding will be done.
    &quot;allowedFieldNames&quot;: [ # Optional. Allowlist of fields that can be used for natural language filter extraction. By default, if this is unspecified, all indexable fields are eligible for natural language filter extraction (but are not guaranteed to be used). If any fields are specified in allowed_field_names, only the fields that are both marked as indexable in the schema and specified in the allowlist will be eligible for natural language filter extraction. Note: for multi-datastore search, this is not yet supported, and will be ignored.
      &quot;A String&quot;,
    ],
    &quot;extractedFilterBehavior&quot;: &quot;A String&quot;, # Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is `HARD_FILTER`. For multi-datastore search, the default behavior is `SOFT_BOOST`. Location-based filters are always applied as hard filters, and the `SOFT_BOOST` setting will not affect them. This field is only used if SearchRequest.natural_language_query_understanding_spec.filter_extraction_condition is set to FilterExtractionCondition.ENABLED.
    &quot;filterExtractionCondition&quot;: &quot;A String&quot;, # The condition under which filter extraction should occur. Server behavior defaults to `DISABLED`.
    &quot;geoSearchQueryDetectionFieldNames&quot;: [ # Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to `ENABLED`. If this field is set, it overrides the field names set in ServingConfig.geo_search_query_detection_field_names.
      &quot;A String&quot;,
    ],
  },
  &quot;offset&quot;: 42, # A 0-indexed integer that specifies the current offset (that is, starting result location, amongst the Documents deemed by the API as relevant) in search results. This field is only considered if page_token is unset. If this field is negative, an `INVALID_ARGUMENT` is returned. A large offset may be capped to a reasonable threshold.
  &quot;oneBoxPageSize&quot;: 42, # The maximum number of results to return for OneBox. This applies to each OneBox type individually. Default number is 10.
  &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. For more information on ordering the website search results, see [Order web search results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results). For more information on ordering the healthcare search results, see [Order healthcare search results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results). If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
  &quot;pageSize&quot;: 42, # Maximum number of Documents to return. The maximum allowed value depends on the data type. Values above the maximum value are coerced to the maximum value. * Websites with basic indexing: Default `10`, Maximum `25`. * Websites with advanced indexing: Default `25`, Maximum `50`. * Other: Default `50`, Maximum `100`. If this field is negative, an `INVALID_ARGUMENT` is returned.
  &quot;pageToken&quot;: &quot;A String&quot;, # A page token received from a previous SearchService.Search call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to SearchService.Search must match the call that provided the page token. Otherwise, an `INVALID_ARGUMENT` error is returned.
  &quot;params&quot;: { # Additional search parameters. For public website search only, supported values are: * `user_country_code`: string. Default empty. If set to non-empty, results are restricted or boosted based on the location provided. For example, `user_country_code: &quot;au&quot;` For available codes see [Country Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes) * `search_type`: double. Default empty. Enables non-webpage searching depending on the value. The only valid non-default value is 1, which enables image searching. For example, `search_type: 1`
    &quot;a_key&quot;: &quot;&quot;,
  },
  &quot;personalizationSpec&quot;: { # The specification for personalization. # The specification for personalization. Notice that if both ServingConfig.personalization_spec and SearchRequest.personalization_spec are set, SearchRequest.personalization_spec overrides ServingConfig.personalization_spec.
    &quot;mode&quot;: &quot;A String&quot;, # The personalization mode of the search request. Defaults to Mode.AUTO.
  },
  &quot;query&quot;: &quot;A String&quot;, # Raw search query.
  &quot;queryExpansionSpec&quot;: { # Specification to determine under which conditions query expansion should occur. # The query expansion specification that specifies the conditions under which query expansion occurs.
    &quot;condition&quot;: &quot;A String&quot;, # The condition under which query expansion should occur. Default to Condition.DISABLED.
    &quot;pinUnexpandedResults&quot;: True or False, # Whether to pin unexpanded results. If this field is set to true, unexpanded products are always at the top of the search results, followed by the expanded results.
  },
  &quot;rankingExpression&quot;: &quot;A String&quot;, # Optional. The ranking expression controls the customized ranking on retrieval documents. This overrides ServingConfig.ranking_expression. The syntax and supported features depend on the `ranking_expression_backend` value. If `ranking_expression_backend` is not provided, it defaults to `RANK_BY_EMBEDDING`. If ranking_expression_backend is not provided or set to `RANK_BY_EMBEDDING`, it should be a single function or multiple functions that are joined by &quot;+&quot;. * ranking_expression = function, { &quot; + &quot;, function }; Supported functions: * double * relevance_score * double * dotProduct(embedding_field_path) Function variables: * `relevance_score`: pre-defined keywords, used for measure relevance between query and document. * `embedding_field_path`: the document embedding field used with query embedding vector. * `dotProduct`: embedding function between `embedding_field_path` and query embedding vector. Example ranking expression: If document has an embedding field doc_embedding, the ranking expression could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`. If ranking_expression_backend is set to `RANK_BY_FORMULA`, the following expression types (and combinations of those chained using + or * operators) are supported: * `double` * `signal` * `log(signal)` * `exp(signal)` * `rr(signal, double &gt; 0)` -- reciprocal rank transformation with second argument being a denominator constant. * `is_nan(signal)` -- returns 0 if signal is NaN, 1 otherwise. * `fill_nan(signal1, signal2 | double)` -- if signal1 is NaN, returns signal2 | double, else returns signal1. Here are a few examples of ranking formulas that use the supported ranking expression types: - `0.2 * semantic_similarity_score + 0.8 * log(keyword_similarity_score)` -- mostly rank by the logarithm of `keyword_similarity_score` with slight `semantic_smilarity_score` adjustment. - `0.2 * exp(fill_nan(semantic_similarity_score, 0)) + 0.3 * is_nan(keyword_similarity_score)` -- rank by the exponent of `semantic_similarity_score` filling the value with 0 if it&#x27;s NaN, also add constant 0.3 adjustment to the final score if `semantic_similarity_score` is NaN. - `0.2 * rr(semantic_similarity_score, 16) + 0.8 * rr(keyword_similarity_score, 16)` -- mostly rank by the reciprocal rank of `keyword_similarity_score` with slight adjustment of reciprocal rank of `semantic_smilarity_score`. The following signals are supported: * `semantic_similarity_score`: semantic similarity adjustment that is calculated using the embeddings generated by a proprietary Google model. This score determines how semantically similar a search query is to a document. * `keyword_similarity_score`: keyword match adjustment uses the Best Match 25 (BM25) ranking function. This score is calculated using a probabilistic model to estimate the probability that a document is relevant to a given query. * `relevance_score`: semantic relevance adjustment that uses a proprietary Google model to determine the meaning and intent behind a user&#x27;s query in context with the content in the documents. * `pctr_rank`: predicted conversion rate adjustment as a rank use predicted Click-through rate (pCTR) to gauge the relevance and attractiveness of a search result from a user&#x27;s perspective. A higher pCTR suggests that the result is more likely to satisfy the user&#x27;s query and intent, making it a valuable signal for ranking. * `freshness_rank`: freshness adjustment as a rank * `document_age`: The time in hours elapsed since the document was last updated, a floating-point number (e.g., 0.25 means 15 minutes). * `topicality_rank`: topicality adjustment as a rank. Uses proprietary Google model to determine the keyword-based overlap between the query and the document. * `base_rank`: the default rank of the result
  &quot;rankingExpressionBackend&quot;: &quot;A String&quot;, # Optional. The backend to use for the ranking expression evaluation.
  &quot;regionCode&quot;: &quot;A String&quot;, # The Unicode country/region code (CLDR) of a location, such as &quot;US&quot; and &quot;419&quot;. For more information, see [Standard fields](https://cloud.google.com/apis/design/standard_fields). If set, then results will be boosted based on the region_code provided.
  &quot;relevanceScoreSpec&quot;: { # The specification for returning the document relevance score. # Optional. The specification for returning the relevance score.
    &quot;returnRelevanceScore&quot;: True or False, # Optional. Whether to return the relevance score for search results. The higher the score, the more relevant the document is to the query.
  },
  &quot;relevanceThreshold&quot;: &quot;A String&quot;, # The relevance threshold of the search results. Default to Google defined threshold, leveraging a balance of precision and recall to deliver both highly accurate results and comprehensive coverage of relevant information. This feature is not supported for healthcare search.
  &quot;safeSearch&quot;: True or False, # Whether to turn on safe search. This is only supported for website search.
  &quot;searchAddonSpec&quot;: { # SearchAddonSpec is used to disable add-ons for search as per new repricing model. By default if the SearchAddonSpec is not specified, we consider that the customer wants to enable them wherever applicable. # Optional. SearchAddonSpec is used to disable add-ons for search as per new repricing model. This field is only supported for search requests.
    &quot;disableGenerativeAnswerAddOn&quot;: True or False, # Optional. If true, generative answer add-on is disabled. Generative answer add-on includes natural language to filters and simple answers.
    &quot;disableKpiPersonalizationAddOn&quot;: True or False, # Optional. If true, disables event re-ranking and personalization to optimize KPIs &amp; personalize results.
    &quot;disableSemanticAddOn&quot;: True or False, # Optional. If true, semantic add-on is disabled. Semantic add-on includes embeddings and jetstream.
  },
  &quot;searchAsYouTypeSpec&quot;: { # Specification for search as you type in search requests. # Search as you type configuration. Only supported for the IndustryVertical.MEDIA vertical.
    &quot;condition&quot;: &quot;A String&quot;, # The condition under which search as you type should occur. Default to Condition.DISABLED.
  },
  &quot;servingConfig&quot;: &quot;A String&quot;, # Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search.
  &quot;session&quot;: &quot;A String&quot;, # The session resource name. Optional. Session allows users to do multi-turn /search API calls or coordination between /search API calls and /answer API calls. Example #1 (multi-turn /search API calls): Call /search API with the session ID generated in the first call. Here, the previous search query gets considered in query standing. I.e., if the first query is &quot;How did Alphabet do in 2022?&quot; and the current query is &quot;How about 2023?&quot;, the current query will be interpreted as &quot;How did Alphabet do in 2023?&quot;. Example #2 (coordination between /search API calls and /answer API calls): Call /answer API with the session ID generated in the first call. Here, the answer generation happens in the context of the search results from the first search call. Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team.
  &quot;sessionSpec&quot;: { # Session specification. Multi-turn Search feature is currently at private GA stage. Please use v1alpha or v1beta version instead before we launch this feature to public GA. Or ask for allowlisting through Google Support team. # Session specification. Can be used only when `session` is set.
    &quot;queryId&quot;: &quot;A String&quot;, # If set, the search result gets stored to the &quot;turn&quot; specified by this query ID. Example: Let&#x27;s say the session looks like this: session { name: &quot;.../sessions/xxx&quot; turns { query { text: &quot;What is foo?&quot; query_id: &quot;.../questions/yyy&quot; } answer: &quot;Foo is ...&quot; } turns { query { text: &quot;How about bar then?&quot; query_id: &quot;.../questions/zzz&quot; } } } The user can call /search API with a request like this: session: &quot;.../sessions/xxx&quot; session_spec { query_id: &quot;.../questions/zzz&quot; } Then, the API stores the search result, associated with the last turn. The stored search result can be used by a subsequent /answer API call (with the session ID and the query ID specified). Also, it is possible to call /search and /answer in parallel with the same session ID &amp; query ID.
    &quot;searchResultPersistenceCount&quot;: 42, # The number of top search results to persist. The persisted search results can be used for the subsequent /answer api call. This field is similar to the `summary_result_count` field in SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count. At most 10 results for documents mode, or 50 for chunks mode.
  },
  &quot;spellCorrectionSpec&quot;: { # The specification for query spell correction. # The spell correction specification that specifies the mode under which spell correction takes effect.
    &quot;mode&quot;: &quot;A String&quot;, # The mode under which spell correction replaces the original search query. Defaults to Mode.AUTO.
  },
  &quot;useLatestData&quot;: True or False, # Uses the Engine, ServingConfig and Control freshly read from the database. Note: this skips config cache and introduces dependency on databases, which could significantly increase the API latency. It should only be used for testing, but not serving end users.
  &quot;userInfo&quot;: { # Information of an end user. # Information about the end user. Highly recommended for analytics and personalization. UserInfo.user_agent is used to deduce `device_type` for analytics.
    &quot;timeZone&quot;: &quot;A String&quot;, # Optional. IANA time zone, e.g. Europe/Budapest.
    &quot;userAgent&quot;: &quot;A String&quot;, # User agent as included in the HTTP header. The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an `INVALID_ARGUMENT` error is returned. This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.
    &quot;userId&quot;: &quot;A String&quot;, # Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don&#x27;t set for anonymous users. Always use a hashed value for this ID. Don&#x27;t set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
  },
  &quot;userLabels&quot;: { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;userPseudoId&quot;: &quot;A String&quot;, # Optional. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and CompleteQueryRequest.user_pseudo_id The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for SearchService.Search method.
  &quot;appliedControls&quot;: [ # Controls applied as part of the Control service.
    &quot;A String&quot;,
  ],
  &quot;attributionToken&quot;: &quot;A String&quot;, # A unique search token. This should be included in the UserEvent logs resulting from this search, which enables accurate attribution of search model performance. This also helps to identify a request during the customer support scenarios.
  &quot;correctedQuery&quot;: &quot;A String&quot;, # Contains the spell corrected query, if found. If the spell correction type is AUTOMATIC, then the search results are based on corrected_query. Otherwise the original query is used for search.
  &quot;facets&quot;: [ # Results of facets requested by user.
    { # A facet result.
      &quot;dynamicFacet&quot;: True or False, # Whether the facet is dynamically generated.
      &quot;key&quot;: &quot;A String&quot;, # The key for this facet. For example, `&quot;colors&quot;` or `&quot;price&quot;`. It matches SearchRequest.FacetSpec.FacetKey.key.
      &quot;values&quot;: [ # The facet values for this field.
        { # A facet value which contains value names and their count.
          &quot;count&quot;: &quot;A String&quot;, # Number of items that have this facet value.
          &quot;interval&quot;: { # A floating point interval. # Interval value for a facet, such as 10, 20) for facet &quot;price&quot;. It matches [SearchRequest.FacetSpec.FacetKey.intervals.
            &quot;exclusiveMaximum&quot;: 3.14, # Exclusive upper bound.
            &quot;exclusiveMinimum&quot;: 3.14, # Exclusive lower bound.
            &quot;maximum&quot;: 3.14, # Inclusive upper bound.
            &quot;minimum&quot;: 3.14, # Inclusive lower bound.
          },
          &quot;value&quot;: &quot;A String&quot;, # Text value of a facet, such as &quot;Black&quot; for facet &quot;colors&quot;.
        },
      ],
    },
  ],
  &quot;geoSearchDebugInfo&quot;: [
    { # Debug information specifically related to forward geocoding issues arising from Geolocation Search.
      &quot;errorMessage&quot;: &quot;A String&quot;, # The error produced.
      &quot;originalAddressQuery&quot;: &quot;A String&quot;, # The address from which forward geocoding ingestion produced issues.
    },
  ],
  &quot;guidedSearchResult&quot;: { # Guided search result. The guided search helps user to refine the search results and narrow down to the real needs from a broaded search results. # Guided search result.
    &quot;followUpQuestions&quot;: [ # Suggested follow-up questions.
      &quot;A String&quot;,
    ],
    &quot;refinementAttributes&quot;: [ # A list of ranked refinement attributes.
      { # Useful attribute for search result refinements.
        &quot;attributeKey&quot;: &quot;A String&quot;, # Attribute key used to refine the results. For example, `&quot;movie_type&quot;`.
        &quot;attributeValue&quot;: &quot;A String&quot;, # Attribute value used to refine the results. For example, `&quot;drama&quot;`.
      },
    ],
  },
  &quot;naturalLanguageQueryUnderstandingInfo&quot;: { # Information describing what natural language understanding was done on the input query. # Natural language query understanding information for the returned results.
    &quot;classifiedIntents&quot;: [ # The classified intents from the input query.
      &quot;A String&quot;,
    ],
    &quot;extractedFilters&quot;: &quot;A String&quot;, # The filters that were extracted from the input query.
    &quot;rewrittenQuery&quot;: &quot;A String&quot;, # Rewritten input query minus the extracted filters.
    &quot;structuredExtractedFilter&quot;: { # The filters that were extracted from the input query represented in a structured form. # The filters that were extracted from the input query represented in a structured form.
      &quot;expression&quot;: { # The expression denoting the filter that was extracted from the input query. # The expression denoting the filter that was extracted from the input query in a structured form. It can be a simple expression denoting a single string, numerical or geolocation constraint or a compound expression which is a combination of multiple expressions connected using logical (OR and AND) operators.
        &quot;andExpr&quot;: { # Logical `And` operator. # Logical &quot;And&quot; compound operator connecting multiple expressions.
          &quot;expressions&quot;: [ # The expressions that were ANDed together.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaSearchResponseNaturalLanguageQueryUnderstandingInfoStructuredExtractedFilterExpression
          ],
        },
        &quot;geolocationConstraint&quot;: { # Constraint of a geolocation field. Name of the geolocation field as defined in the schema. # Geolocation constraint expression.
          &quot;address&quot;: &quot;A String&quot;, # The reference address that was inferred from the input query. The proximity of the reference address to the geolocation field will be used to filter the results.
          &quot;fieldName&quot;: &quot;A String&quot;, # The name of the geolocation field as defined in the schema.
          &quot;latitude&quot;: 3.14, # The latitude of the geolocation inferred from the input query.
          &quot;longitude&quot;: 3.14, # The longitude of the geolocation inferred from the input query.
          &quot;radiusInMeters&quot;: 3.14, # The radius in meters around the address. The record is returned if the location of the geolocation field is within the radius.
        },
        &quot;numberConstraint&quot;: { # Constraint expression of a number field. Example: price &lt; 100. # Numerical constraint expression.
          &quot;comparison&quot;: &quot;A String&quot;, # The comparison operation performed between the field value and the value specified in the constraint.
          &quot;fieldName&quot;: &quot;A String&quot;, # Name of the numerical field as defined in the schema.
          &quot;querySegment&quot;: &quot;A String&quot;, # Identifies the keywords within the search query that match a filter.
          &quot;value&quot;: 3.14, # The value specified in the numerical constraint.
        },
        &quot;orExpr&quot;: { # Logical `Or` operator. # Logical &quot;Or&quot; compound operator connecting multiple expressions.
          &quot;expressions&quot;: [ # The expressions that were ORed together.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaSearchResponseNaturalLanguageQueryUnderstandingInfoStructuredExtractedFilterExpression
          ],
        },
        &quot;stringConstraint&quot;: { # Constraint expression of a string field. # String constraint expression.
          &quot;fieldName&quot;: &quot;A String&quot;, # Name of the string field as defined in the schema.
          &quot;querySegment&quot;: &quot;A String&quot;, # Identifies the keywords within the search query that match a filter.
          &quot;values&quot;: [ # Values of the string field. The record will only be returned if the field value matches one of the values specified here.
            &quot;A String&quot;,
          ],
        },
      },
    },
  },
  &quot;nextPageToken&quot;: &quot;A String&quot;, # A token that can be sent as SearchRequest.page_token to retrieve the next page. If this field is omitted, there are no subsequent pages.
  &quot;oneBoxResults&quot;: [ # A list of One Box results. There can be multiple One Box results of different types.
    { # OneBoxResult is a holder for all results of specific type that we want to display in UI differently.
      &quot;oneBoxType&quot;: &quot;A String&quot;, # The type of One Box result.
      &quot;searchResults&quot;: [ # The search results for this One Box.
        { # Represents the search results.
          &quot;chunk&quot;: { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode. # The chunk data in the search response if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
            &quot;annotationContents&quot;: [ # Output only. Annotation contents if the current chunk contains annotations.
              &quot;A String&quot;,
            ],
            &quot;annotationMetadata&quot;: [ # Output only. The annotation metadata includes structured content in the current chunk.
              { # The annotation metadata includes structured content in the current chunk.
                &quot;imageId&quot;: &quot;A String&quot;, # Output only. Image id is provided if the structured content is based on an image.
                &quot;structuredContent&quot;: { # The structured content information. # Output only. The structured content information.
                  &quot;content&quot;: &quot;A String&quot;, # Output only. The content of the structured content.
                  &quot;structureType&quot;: &quot;A String&quot;, # Output only. The structure type of the structured content.
                },
              },
            ],
            &quot;chunkMetadata&quot;: { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
              &quot;nextChunks&quot;: [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
                # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
              ],
              &quot;previousChunks&quot;: [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
                # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
              ],
            },
            &quot;content&quot;: &quot;A String&quot;, # Content is a string from a document (parsed content).
            &quot;dataUrls&quot;: [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
              &quot;A String&quot;,
            ],
            &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
              &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
              &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
              &quot;title&quot;: &quot;A String&quot;, # Title of the document.
              &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
            },
            &quot;id&quot;: &quot;A String&quot;, # Unique chunk ID of the current chunk.
            &quot;name&quot;: &quot;A String&quot;, # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
            &quot;pageSpan&quot;: { # Page span of the chunk. # Page span of the chunk.
              &quot;pageEnd&quot;: 42, # The end page of the chunk.
              &quot;pageStart&quot;: 42, # The start page of the chunk.
            },
            &quot;relevanceScore&quot;: 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
          },
          &quot;document&quot;: { # Document captures all raw metadata information of items to be recommended or searched. # The document data snippet in the search response. Only fields that are marked as `retrievable` are populated.
            &quot;aclInfo&quot;: { # ACL Information of the Document. # Access control information for the document.
              &quot;readers&quot;: [ # Readers of the document.
                { # AclRestriction to model complex inheritance restrictions. Example: Modeling a &quot;Both Permit&quot; inheritance, where to access a child document, user needs to have access to parent document. Document Hierarchy - Space_S --&gt; Page_P. Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2 Space_S ACL Restriction - { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ] } ] } } Page_P ACL Restriction. { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_2&quot; }, { &quot;group_id&quot;: &quot;group_3&quot; }, { &quot;user_id&quot;: &quot;user_2&quot; } ], }, { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ], } ] } }
                  &quot;idpWide&quot;: True or False, # All users within the Identity Provider.
                  &quot;principals&quot;: [ # List of principals.
                    { # Principal identifier of a user or a group.
                      &quot;externalEntityId&quot;: &quot;A String&quot;, # For 3P application identities which are not present in the customer identity provider.
                      &quot;groupId&quot;: &quot;A String&quot;, # Group identifier. For Google Workspace user account, group_id should be the google workspace group email. For non-google identity provider user account, group_id is the mapped group identifier configured during the workforcepool config.
                      &quot;userId&quot;: &quot;A String&quot;, # User identifier. For Google Workspace user account, user_id should be the google workspace user email. For non-google identity provider user account, user_id is the mapped user identifier configured during the workforcepool config.
                    },
                  ],
                },
              ],
            },
            &quot;content&quot;: { # Unstructured data linked to this document. # The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
              &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `text/plain` (TXT) * `application/xml` or `text/xml` (XML) * `application/json` (JSON) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: * `image/bmp` (BMP) * `image/gif` (GIF) * `image/jpeg` (JPEG) * `image/png` (PNG) * `image/tiff` (TIFF) See https://www.iana.org/assignments/media-types/media-types.xhtml.
              &quot;rawBytes&quot;: &quot;A String&quot;, # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&amp;()&#x27;-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.
            },
            &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;id&quot;: &quot;A String&quot;, # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters.
            &quot;indexStatus&quot;: { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document&#x27;s index is in progress, the pending_message field is populated.
              &quot;errorSamples&quot;: [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
                { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
                  &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
                  &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                    {
                      &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                    },
                  ],
                  &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
                },
              ],
              &quot;indexTime&quot;: &quot;A String&quot;, # The time when the document was indexed. If this field is populated, it means the document has been indexed.
              &quot;pendingMessage&quot;: &quot;A String&quot;, # Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
            },
            &quot;indexTime&quot;: &quot;A String&quot;, # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
            &quot;jsonData&quot;: &quot;A String&quot;, # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
            &quot;name&quot;: &quot;A String&quot;, # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
            &quot;parentDocumentId&quot;: &quot;A String&quot;, # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
            &quot;schemaId&quot;: &quot;A String&quot;, # The identifier of the schema located in the same data store.
            &quot;structData&quot;: { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;id&quot;: &quot;A String&quot;, # Document.id of the searched Document.
          &quot;modelScores&quot;: { # Output only. Google provided available scores.
            &quot;a_key&quot;: { # Double list.
              &quot;values&quot;: [ # Double values.
                3.14,
              ],
            },
          },
          &quot;rankSignals&quot;: { # A set of ranking signals. # Optional. A set of ranking signals associated with the result.
            &quot;boostingFactor&quot;: 3.14, # Optional. Combined custom boosts for a doc.
            &quot;customSignals&quot;: [ # Optional. A list of custom clearbox signals.
              { # Custom clearbox signal represented by name and value pair.
                &quot;name&quot;: &quot;A String&quot;, # Optional. Name of the signal.
                &quot;value&quot;: 3.14, # Optional. Float value representing the ranking signal (e.g. 1.25 for BM25).
              },
            ],
            &quot;defaultRank&quot;: 3.14, # Optional. The default rank of the result.
            &quot;documentAge&quot;: 3.14, # Optional. Age of the document in hours.
            &quot;keywordSimilarityScore&quot;: 3.14, # Optional. Keyword matching adjustment.
            &quot;pctrRank&quot;: 3.14, # Optional. Predicted conversion rate adjustment as a rank.
            &quot;relevanceScore&quot;: 3.14, # Optional. Semantic relevance adjustment.
            &quot;semanticSimilarityScore&quot;: 3.14, # Optional. Semantic similarity adjustment.
            &quot;topicalityRank&quot;: 3.14, # Optional. Topicality adjustment as a rank.
          },
        },
      ],
    },
  ],
  &quot;queryExpansionInfo&quot;: { # Information describing query expansion including whether expansion has occurred. # Query expansion information for the returned results.
    &quot;expandedQuery&quot;: True or False, # Bool describing whether query expansion has occurred.
    &quot;pinnedResultCount&quot;: &quot;A String&quot;, # Number of pinned results. This field will only be set when expansion happens and SearchRequest.QueryExpansionSpec.pin_unexpanded_results is set to true.
  },
  &quot;redirectUri&quot;: &quot;A String&quot;, # The URI of a customer-defined redirect page. If redirect action is triggered, no search is performed, and only redirect_uri and attribution_token are set in the response.
  &quot;results&quot;: [ # A list of matched documents. The order represents the ranking.
    { # Represents the search results.
      &quot;chunk&quot;: { # Chunk captures all raw metadata information of items to be recommended or searched in the chunk mode. # The chunk data in the search response if the SearchRequest.ContentSearchSpec.search_result_mode is set to CHUNKS.
        &quot;annotationContents&quot;: [ # Output only. Annotation contents if the current chunk contains annotations.
          &quot;A String&quot;,
        ],
        &quot;annotationMetadata&quot;: [ # Output only. The annotation metadata includes structured content in the current chunk.
          { # The annotation metadata includes structured content in the current chunk.
            &quot;imageId&quot;: &quot;A String&quot;, # Output only. Image id is provided if the structured content is based on an image.
            &quot;structuredContent&quot;: { # The structured content information. # Output only. The structured content information.
              &quot;content&quot;: &quot;A String&quot;, # Output only. The content of the structured content.
              &quot;structureType&quot;: &quot;A String&quot;, # Output only. The structure type of the structured content.
            },
          },
        ],
        &quot;chunkMetadata&quot;: { # Metadata of the current chunk. This field is only populated on SearchService.Search API. # Output only. Metadata of the current chunk.
          &quot;nextChunks&quot;: [ # The next chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks. This field is only populated on SearchService.Search API.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
          ],
          &quot;previousChunks&quot;: [ # The previous chunks of the current chunk. The number is controlled by SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks. This field is only populated on SearchService.Search API.
            # Object with schema name: GoogleCloudDiscoveryengineV1alphaChunk
          ],
        },
        &quot;content&quot;: &quot;A String&quot;, # Content is a string from a document (parsed content).
        &quot;dataUrls&quot;: [ # Output only. Image Data URLs if the current chunk contains images. Data URLs are composed of four parts: a prefix (data:), a MIME type indicating the type of data, an optional base64 token if non-textual, and the data itself: data:,
          &quot;A String&quot;,
        ],
        &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
          &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
          &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
        },
        &quot;id&quot;: &quot;A String&quot;, # Unique chunk ID of the current chunk.
        &quot;name&quot;: &quot;A String&quot;, # The full resource name of the chunk. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
        &quot;pageSpan&quot;: { # Page span of the chunk. # Page span of the chunk.
          &quot;pageEnd&quot;: 42, # The end page of the chunk.
          &quot;pageStart&quot;: 42, # The start page of the chunk.
        },
        &quot;relevanceScore&quot;: 3.14, # Output only. Represents the relevance score based on similarity. Higher score indicates higher chunk relevance. The score is in range [-1.0, 1.0]. Only populated on SearchResponse.
      },
      &quot;document&quot;: { # Document captures all raw metadata information of items to be recommended or searched. # The document data snippet in the search response. Only fields that are marked as `retrievable` are populated.
        &quot;aclInfo&quot;: { # ACL Information of the Document. # Access control information for the document.
          &quot;readers&quot;: [ # Readers of the document.
            { # AclRestriction to model complex inheritance restrictions. Example: Modeling a &quot;Both Permit&quot; inheritance, where to access a child document, user needs to have access to parent document. Document Hierarchy - Space_S --&gt; Page_P. Readers: Space_S: group_1, user_1 Page_P: group_2, group_3, user_2 Space_S ACL Restriction - { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ] } ] } } Page_P ACL Restriction. { &quot;acl_info&quot;: { &quot;readers&quot;: [ { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_2&quot; }, { &quot;group_id&quot;: &quot;group_3&quot; }, { &quot;user_id&quot;: &quot;user_2&quot; } ], }, { &quot;principals&quot;: [ { &quot;group_id&quot;: &quot;group_1&quot; }, { &quot;user_id&quot;: &quot;user_1&quot; } ], } ] } }
              &quot;idpWide&quot;: True or False, # All users within the Identity Provider.
              &quot;principals&quot;: [ # List of principals.
                { # Principal identifier of a user or a group.
                  &quot;externalEntityId&quot;: &quot;A String&quot;, # For 3P application identities which are not present in the customer identity provider.
                  &quot;groupId&quot;: &quot;A String&quot;, # Group identifier. For Google Workspace user account, group_id should be the google workspace group email. For non-google identity provider user account, group_id is the mapped group identifier configured during the workforcepool config.
                  &quot;userId&quot;: &quot;A String&quot;, # User identifier. For Google Workspace user account, user_id should be the google workspace user email. For non-google identity provider user account, user_id is the mapped user identifier configured during the workforcepool config.
                },
              ],
            },
          ],
        },
        &quot;content&quot;: { # Unstructured data linked to this document. # The unstructured data linked to this document. Content can only be set and must be set if this document is under a `CONTENT_REQUIRED` data store.
          &quot;mimeType&quot;: &quot;A String&quot;, # The MIME type of the content. Supported types: * `application/pdf` (PDF, only native PDFs are supported for now) * `text/html` (HTML) * `text/plain` (TXT) * `application/xml` or `text/xml` (XML) * `application/json` (JSON) * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX) * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX) * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet` (XLSX) * `application/vnd.ms-excel.sheet.macroenabled.12` (XLSM) The following types are supported only if layout parser is enabled in the data store: * `image/bmp` (BMP) * `image/gif` (GIF) * `image/jpeg` (JPEG) * `image/png` (PNG) * `image/tiff` (TIFF) See https://www.iana.org/assignments/media-types/media-types.xhtml.
          &quot;rawBytes&quot;: &quot;A String&quot;, # The content represented as a stream of bytes. The maximum length is 1,000,000 bytes (1 MB / ~0.95 MiB). Note: As with all `bytes` fields, this field is represented as pure binary in Protocol Buffers and base64-encoded string in JSON. For example, `abc123!?$*&amp;()&#x27;-=@~` should be represented as `YWJjMTIzIT8kKiYoKSctPUB+` in JSON. See https://developers.google.com/protocol-buffers/docs/proto3#json.
          &quot;uri&quot;: &quot;A String&quot;, # The URI of the content. Only Cloud Storage URIs (e.g. `gs://bucket-name/path/to/file`) are supported. The maximum file size is 2.5 MB for text-based formats, 200 MB for other formats.
        },
        &quot;derivedStructData&quot;: { # Output only. This field is OUTPUT_ONLY. It contains derived data that are not in the original input document.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;id&quot;: &quot;A String&quot;, # Immutable. The identifier of the document. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 128 characters.
        &quot;indexStatus&quot;: { # Index status of the document. # Output only. The index status of the document. * If document is indexed successfully, the index_time field is populated. * Otherwise, if document is not indexed due to errors, the error_samples field is populated. * Otherwise, if document&#x27;s index is in progress, the pending_message field is populated.
          &quot;errorSamples&quot;: [ # A sample of errors encountered while indexing the document. If this field is populated, the document is not indexed due to errors.
            { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
              &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
              &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                {
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                },
              ],
              &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
            },
          ],
          &quot;indexTime&quot;: &quot;A String&quot;, # The time when the document was indexed. If this field is populated, it means the document has been indexed.
          &quot;pendingMessage&quot;: &quot;A String&quot;, # Immutable. The message indicates the document index is in progress. If this field is populated, the document index is pending.
        },
        &quot;indexTime&quot;: &quot;A String&quot;, # Output only. The last time the document was indexed. If this field is set, the document could be returned in search results. This field is OUTPUT_ONLY. If this field is not populated, it means the document has never been indexed.
        &quot;jsonData&quot;: &quot;A String&quot;, # The JSON string representation of the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
        &quot;name&quot;: &quot;A String&quot;, # Immutable. The full resource name of the document. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}`. This field must be a UTF-8 encoded string with a length limit of 1024 characters.
        &quot;parentDocumentId&quot;: &quot;A String&quot;, # The identifier of the parent document. Currently supports at most two level document hierarchy. Id should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
        &quot;schemaId&quot;: &quot;A String&quot;, # The identifier of the schema located in the same data store.
        &quot;structData&quot;: { # The structured JSON data for the document. It should conform to the registered Schema or an `INVALID_ARGUMENT` error is thrown.
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
      },
      &quot;id&quot;: &quot;A String&quot;, # Document.id of the searched Document.
      &quot;modelScores&quot;: { # Output only. Google provided available scores.
        &quot;a_key&quot;: { # Double list.
          &quot;values&quot;: [ # Double values.
            3.14,
          ],
        },
      },
      &quot;rankSignals&quot;: { # A set of ranking signals. # Optional. A set of ranking signals associated with the result.
        &quot;boostingFactor&quot;: 3.14, # Optional. Combined custom boosts for a doc.
        &quot;customSignals&quot;: [ # Optional. A list of custom clearbox signals.
          { # Custom clearbox signal represented by name and value pair.
            &quot;name&quot;: &quot;A String&quot;, # Optional. Name of the signal.
            &quot;value&quot;: 3.14, # Optional. Float value representing the ranking signal (e.g. 1.25 for BM25).
          },
        ],
        &quot;defaultRank&quot;: 3.14, # Optional. The default rank of the result.
        &quot;documentAge&quot;: 3.14, # Optional. Age of the document in hours.
        &quot;keywordSimilarityScore&quot;: 3.14, # Optional. Keyword matching adjustment.
        &quot;pctrRank&quot;: 3.14, # Optional. Predicted conversion rate adjustment as a rank.
        &quot;relevanceScore&quot;: 3.14, # Optional. Semantic relevance adjustment.
        &quot;semanticSimilarityScore&quot;: 3.14, # Optional. Semantic similarity adjustment.
        &quot;topicalityRank&quot;: 3.14, # Optional. Topicality adjustment as a rank.
      },
    },
  ],
  &quot;searchLinkPromotions&quot;: [ # Promotions for site search.
    { # Promotion proto includes uri and other helping information to display the promotion.
      &quot;description&quot;: &quot;A String&quot;, # Optional. The Promotion description. Maximum length: 200 characters.
      &quot;document&quot;: &quot;A String&quot;, # Optional. The Document the user wants to promote. For site search, leave unset and only populate uri. Can be set along with uri.
      &quot;enabled&quot;: True or False, # Optional. The enabled promotion will be returned for any serving configs associated with the parent of the control this promotion is attached to. This flag is used for basic site search only.
      &quot;imageUri&quot;: &quot;A String&quot;, # Optional. The promotion thumbnail image url.
      &quot;title&quot;: &quot;A String&quot;, # Required. The title of the promotion. Maximum length: 160 characters.
      &quot;uri&quot;: &quot;A String&quot;, # Optional. The URL for the page the user wants to promote. Must be set for site search. For other verticals, this is optional.
    },
  ],
  &quot;sessionInfo&quot;: { # Information about the session. # Session information. Only set if SearchRequest.session is provided. See its description for more details.
    &quot;name&quot;: &quot;A String&quot;, # Name of the session. If the auto-session mode is used (when SearchRequest.session ends with &quot;-&quot;), this field holds the newly generated session name.
    &quot;queryId&quot;: &quot;A String&quot;, # Query ID that corresponds to this search API call. One session can have multiple turns, each with a unique query ID. By specifying the session name and this query ID in the Answer API call, the answer generation happens in the context of the search results from this search call.
  },
  &quot;suggestedQuery&quot;: &quot;A String&quot;, # Corrected query with low confidence, AKA did you mean query. Compared with corrected_query, this field is set when SpellCorrector returned a response, but FPR(full page replacement) is not triggered because the corrction is of low confidence(eg, reversed because there are matches of the original query in document corpus).
  &quot;summary&quot;: { # Summary of the top N search results specified by the summary spec. # A summary as part of the search results. This field is only returned if SearchRequest.ContentSearchSpec.summary_spec is set.
    &quot;safetyAttributes&quot;: { # Safety Attribute categories and their associated confidence scores. # A collection of Safety Attribute categories and their associated confidence scores.
      &quot;categories&quot;: [ # The display names of Safety Attribute categories associated with the generated content. Order matches the Scores.
        &quot;A String&quot;,
      ],
      &quot;scores&quot;: [ # The confidence scores of the each category, higher value means higher confidence. Order matches the Categories.
        3.14,
      ],
    },
    &quot;summarySkippedReasons&quot;: [ # Additional summary-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
      &quot;A String&quot;,
    ],
    &quot;summaryText&quot;: &quot;A String&quot;, # The summary content.
    &quot;summaryWithMetadata&quot;: { # Summary with metadata information. # Summary with metadata information.
      &quot;blobAttachments&quot;: [ # Output only. Store multimodal data for answer enhancement.
        { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
          &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
          &quot;data&quot;: { # Stores type and data of the blob. # Output only. The blob data.
            &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
            &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated data.
          },
        },
      ],
      &quot;citationMetadata&quot;: { # Citation metadata. # Citation metadata for given summary.
        &quot;citations&quot;: [ # Citations for segments.
          { # Citation info for a segment.
            &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive.
            &quot;sources&quot;: [ # Citation sources for the attributed segment.
              { # Citation source.
                &quot;referenceIndex&quot;: &quot;A String&quot;, # Document reference index from SummaryWithMetadata.references. It is 0-indexed and the value will be zero if the reference_index is not set explicitly.
              },
            ],
            &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes/unicode.
          },
        ],
      },
      &quot;references&quot;: [ # Document References.
        { # Document reference.
          &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
            { # Chunk content.
              &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                &quot;A String&quot;,
              ],
              &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
              &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
            },
          ],
          &quot;document&quot;: &quot;A String&quot;, # Required. Document.name of the document. Full resource name of the referenced document, in the format `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
          &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Cloud Storage or HTTP uri for the document.
        },
      ],
      &quot;summary&quot;: &quot;A String&quot;, # Summary text with no citation information.
    },
  },
  &quot;totalSize&quot;: 42, # The estimated total count of matched items irrespective of pagination. The count of results returned by pagination may be less than the total_size that matches.
}</pre>
</div>

<div class="method">
    <code class="details" id="searchLite_next">searchLite_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="search_next">search_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="streamAnswer">streamAnswer(servingConfig, body=None, x__xgafv=None)</code>
  <pre>Answer query method (streaming). It takes one AnswerQueryRequest and returns multiple AnswerQueryResponse messages in a stream.

Args:
  servingConfig: string, Required. The resource name of the Search serving config, such as `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`, or `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`. This field is used to identify the serving configuration name, set of models used to make the search. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ConversationalSearchService.AnswerQuery method.
  &quot;answerGenerationSpec&quot;: { # Answer generation specification. # Answer generation specification.
    &quot;answerLanguageCode&quot;: &quot;A String&quot;, # Language code for Answer. Use language tags defined by [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt). Note: This is an experimental feature.
    &quot;ignoreAdversarialQuery&quot;: True or False, # Specifies whether to filter out adversarial queries. The default value is `false`. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to `true`, we skip generating answers for adversarial queries and return fallback messages instead.
    &quot;ignoreJailBreakingQuery&quot;: True or False, # Optional. Specifies whether to filter out jail-breaking queries. The default value is `false`. Google employs search-query classification to detect jail-breaking queries. No summary is returned if the search query is classified as a jail-breaking query. A user might add instructions to the query to change the tone, style, language, content of the answer, or ask the model to act as a different entity, e.g. &quot;Reply in the tone of a competing company&#x27;s CEO&quot;. If this field is set to `true`, we skip generating summaries for jail-breaking queries and return fallback messages instead.
    &quot;ignoreLowRelevantContent&quot;: True or False, # Specifies whether to filter out queries that have low relevance. If this field is set to `false`, all search results are used regardless of relevance to generate answers. If set to `true` or unset, the behavior will be determined automatically by the service.
    &quot;ignoreNonAnswerSeekingQuery&quot;: True or False, # Specifies whether to filter out queries that are not answer-seeking. The default value is `false`. Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to `true`, we skip generating answers for non-answer seeking queries and return fallback messages instead.
    &quot;includeCitations&quot;: True or False, # Specifies whether to include citation metadata in the answer. The default value is `false`.
    &quot;modelSpec&quot;: { # Answer Generation Model specification. # Answer generation model specification.
      &quot;modelVersion&quot;: &quot;A String&quot;, # Model version. If not set, it will use the default stable model. Allowed values are: stable, preview.
    },
    &quot;multimodalSpec&quot;: { # Multimodal specification: Will return an image from specified source. If multiple sources are specified, the pick is a quality based decision. # Optional. Multimodal specification.
      &quot;imageSource&quot;: &quot;A String&quot;, # Optional. Source of image returned in the answer.
    },
    &quot;promptSpec&quot;: { # Answer generation prompt specification. # Answer generation prompt specification.
      &quot;preamble&quot;: &quot;A String&quot;, # Customized preamble.
    },
  },
  &quot;asynchronousMode&quot;: True or False, # Deprecated: This field is deprecated. Streaming Answer API will be supported. Asynchronous mode control. If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.
  &quot;endUserSpec&quot;: { # End user specification. # Optional. End user specification.
    &quot;endUserMetadata&quot;: [ # Optional. End user metadata.
      { # End user metadata.
        &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
          &quot;content&quot;: &quot;A String&quot;, # Chunk textual content. It is limited to 8000 characters.
          &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
            &quot;title&quot;: &quot;A String&quot;, # Title of the document.
          },
        },
      },
    ],
  },
  &quot;groundingSpec&quot;: { # Grounding specification. # Optional. Grounding specification.
    &quot;filteringLevel&quot;: &quot;A String&quot;, # Optional. Specifies whether to enable the filtering based on grounding score and at what level.
    &quot;includeGroundingSupports&quot;: True or False, # Optional. Specifies whether to include grounding_supports in the answer. The default value is `false`. When this field is set to `true`, returned answer will have `grounding_score` and will contain GroundingSupports for each claim.
  },
  &quot;query&quot;: { # Defines a user inputed query. # Required. Current user query.
    &quot;queryId&quot;: &quot;A String&quot;, # Output only. Unique Id for the query.
    &quot;text&quot;: &quot;A String&quot;, # Plain text.
  },
  &quot;queryUnderstandingSpec&quot;: { # Query understanding specification. # Query understanding specification.
    &quot;disableSpellCorrection&quot;: True or False, # Optional. Whether to disable spell correction. The default value is `false`.
    &quot;queryClassificationSpec&quot;: { # Query classification specification. # Query classification specification.
      &quot;types&quot;: [ # Enabled query classification types.
        &quot;A String&quot;,
      ],
    },
    &quot;queryRephraserSpec&quot;: { # Query rephraser specification. # Query rephraser specification.
      &quot;disable&quot;: True or False, # Disable query rephraser.
      &quot;maxRephraseSteps&quot;: 42, # Max rephrase steps. The max number is 5 steps. If not set or set to &lt; 1, it will be set to 1 by default.
      &quot;modelSpec&quot;: { # Query Rephraser Model specification. # Optional. Query Rephraser Model specification.
        &quot;modelType&quot;: &quot;A String&quot;, # Optional. Enabled query rephraser model type. If not set, it will use LARGE by default.
      },
    },
  },
  &quot;relatedQuestionsSpec&quot;: { # Related questions specification. # Related questions specification.
    &quot;enable&quot;: True or False, # Enable related questions feature if true.
  },
  &quot;safetySpec&quot;: { # Safety specification. There are two use cases: 1. when only safety_spec.enable is set, the BLOCK_LOW_AND_ABOVE threshold will be applied for all categories. 2. when safety_spec.enable is set and some safety_settings are set, only specified safety_settings are applied. # Model specification.
    &quot;enable&quot;: True or False, # Enable the safety filtering on the answer response. It is false by default.
    &quot;safetySettings&quot;: [ # Optional. Safety settings. This settings are effective only when the safety_spec.enable is true.
      { # Safety settings.
        &quot;category&quot;: &quot;A String&quot;, # Required. Harm category.
        &quot;threshold&quot;: &quot;A String&quot;, # Required. The harm block threshold.
      },
    ],
  },
  &quot;searchSpec&quot;: { # Search specification. # Search specification.
    &quot;searchParams&quot;: { # Search parameters. # Search parameters.
      &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Boost specification to boost certain documents in search results which may affect the answer query response. For more information on boosting, see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
        &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
          { # Boost applies to documents which match a condition.
            &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
            &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
              &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
              &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                  &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                  &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                },
              ],
              &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
              &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
            },
            &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
          },
        ],
      },
      &quot;customFineTuningSpec&quot;: { # Defines custom fine tuning spec. # Custom fine tuning configs.
        &quot;enableSearchAdaptor&quot;: True or False, # Whether or not to enable and include custom fine tuned search adaptor model.
      },
      &quot;dataStoreSpecs&quot;: [ # Specs defining dataStores to filter on in a search call and configurations for those dataStores. This is only considered for engines with multiple dataStores use case. For single dataStore within an engine, they should use the specs at the top level.
        { # A struct to define data stores to filter on in a search call and configurations for those data stores. Otherwise, an `INVALID_ARGUMENT` error is returned.
          &quot;boostSpec&quot;: { # Boost specification to boost certain documents. # Optional. Boost specification to boost certain documents. For more information on boosting, see [Boosting](https://cloud.google.com/generative-ai-app-builder/docs/boost-search-results)
            &quot;conditionBoostSpecs&quot;: [ # Condition boost specifications. If a document matches multiple conditions in the specifications, boost scores from these specifications are all applied and combined in a non-linear way. Maximum number of specifications is 20.
              { # Boost applies to documents which match a condition.
                &quot;boost&quot;: 3.14, # Strength of the condition boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0. Setting to 1.0 gives the document a big promotion. However, it does not necessarily mean that the boosted document will be the top result at all times, nor that other documents will be excluded. Results could still be shown even when none of them matches the condition. And results that are significantly more relevant to the search query can still trump your heavily favored but irrelevant documents. Setting to -1.0 gives the document a big demotion. However, results that are deeply relevant might still be shown. The document will have an upstream battle to get a fairly high ranking, but it is not blocked out completely. Setting to 0.0 means no boost applied. The boosting condition is ignored. Only one of the (condition, boost) combination or the boost_control_spec below are set. If both are set then the global boost is ignored and the more fine-grained boost_control_spec is applied.
                &quot;boostControlSpec&quot;: { # Specification for custom ranking based on customer specified attribute value. It provides more controls for customized ranking than the simple (condition, boost) combination above. # Complex specification for custom ranking based on customer defined attribute value.
                  &quot;attributeType&quot;: &quot;A String&quot;, # The attribute type to be used to determine the boost amount. The attribute value can be derived from the field value of the specified field_name. In the case of numerical it is straightforward i.e. attribute_value = numerical_field_value. In the case of freshness however, attribute_value = (time.now() - datetime_field_value).
                  &quot;controlPoints&quot;: [ # The control points used to define the curve. The monotonic function (defined through the interpolation_type above) passes through the control points listed here.
                    { # The control points used to define the curve. The curve defined through these control points can only be monotonically increasing or decreasing(constant values are acceptable).
                      &quot;attributeValue&quot;: &quot;A String&quot;, # Can be one of: 1. The numerical field value. 2. The duration spec for freshness: The value must be formatted as an XSD `dayTimeDuration` value (a restricted subset of an ISO 8601 duration value). The pattern for this is: `nDnM]`.
                      &quot;boostAmount&quot;: 3.14, # The value between -1 to 1 by which to boost the score if the attribute_value evaluates to the value specified above.
                    },
                  ],
                  &quot;fieldName&quot;: &quot;A String&quot;, # The name of the field whose value will be used to determine the boost amount.
                  &quot;interpolationType&quot;: &quot;A String&quot;, # The interpolation type to be applied to connect the control points listed below.
                },
                &quot;condition&quot;: &quot;A String&quot;, # An expression which specifies a boost condition. The syntax and supported fields are the same as a filter expression. See SearchRequest.filter for detail syntax and limitations. Examples: * To boost documents with document ID &quot;doc_1&quot; or &quot;doc_2&quot;, and color &quot;Red&quot; or &quot;Blue&quot;: `(document_id: ANY(&quot;doc_1&quot;, &quot;doc_2&quot;)) AND (color: ANY(&quot;Red&quot;, &quot;Blue&quot;))`
              },
            ],
          },
          &quot;customSearchOperators&quot;: &quot;A String&quot;, # Optional. Custom search operators which if specified will be used to filter results from workspace data stores. For more information on custom search operators, see [SearchOperators](https://support.google.com/cloudsearch/answer/6172299).
          &quot;dataStore&quot;: &quot;A String&quot;, # Required. Full resource name of DataStore, such as `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`. The path must include the project number, project id is not supported for this field.
          &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
        },
      ],
      &quot;filter&quot;: &quot;A String&quot;, # The filter syntax consists of an expression language for constructing a predicate from one or more fields of the documents being filtered. Filter expression is case-sensitive. This will be used to filter search results which may affect the Answer response. If this field is unrecognizable, an `INVALID_ARGUMENT` is returned. Filtering in Vertex AI Search is done by mapping the LHS filter key to a key property defined in the Vertex AI Search backend -- this mapping is defined by the customer in their schema. For example a media customers might have a field &#x27;name&#x27; in their schema. In this case the filter would look like this: filter --&gt; name:&#x27;ANY(&quot;king kong&quot;)&#x27; For more information about filtering including syntax and filter operators, see [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
      &quot;maxReturnResults&quot;: 42, # Number of search results to return. The default value is 10.
      &quot;naturalLanguageQueryUnderstandingSpec&quot;: { # Specification to enable natural language understanding capabilities for search requests. # Optional. Specification to enable natural language understanding capabilities for search requests.
        &quot;allowedFieldNames&quot;: [ # Optional. Allowlist of fields that can be used for natural language filter extraction. By default, if this is unspecified, all indexable fields are eligible for natural language filter extraction (but are not guaranteed to be used). If any fields are specified in allowed_field_names, only the fields that are both marked as indexable in the schema and specified in the allowlist will be eligible for natural language filter extraction. Note: for multi-datastore search, this is not yet supported, and will be ignored.
          &quot;A String&quot;,
        ],
        &quot;extractedFilterBehavior&quot;: &quot;A String&quot;, # Optional. Controls behavior of how extracted filters are applied to the search. The default behavior depends on the request. For single datastore structured search, the default is `HARD_FILTER`. For multi-datastore search, the default behavior is `SOFT_BOOST`. Location-based filters are always applied as hard filters, and the `SOFT_BOOST` setting will not affect them. This field is only used if SearchRequest.natural_language_query_understanding_spec.filter_extraction_condition is set to FilterExtractionCondition.ENABLED.
        &quot;filterExtractionCondition&quot;: &quot;A String&quot;, # The condition under which filter extraction should occur. Server behavior defaults to `DISABLED`.
        &quot;geoSearchQueryDetectionFieldNames&quot;: [ # Field names used for location-based filtering, where geolocation filters are detected in natural language search queries. Only valid when the FilterExtractionCondition is set to `ENABLED`. If this field is set, it overrides the field names set in ServingConfig.geo_search_query_detection_field_names.
          &quot;A String&quot;,
        ],
      },
      &quot;orderBy&quot;: &quot;A String&quot;, # The order in which documents are returned. Documents can be ordered by a field in an Document object. Leave it unset if ordered by relevance. `order_by` expression is case-sensitive. For more information on ordering, see [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order) If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
      &quot;searchResultMode&quot;: &quot;A String&quot;, # Specifies the search result mode. If unspecified, the search result mode defaults to `DOCUMENTS`. See [parse and chunk documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    },
    &quot;searchResultList&quot;: { # Search result list. # Search result list.
      &quot;searchResults&quot;: [ # Search results.
        { # Search result.
          &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
            &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
            &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
            &quot;documentMetadata&quot;: { # Document metadata contains the information of the document of the current chunk. # Metadata of the document from the current chunk.
              &quot;title&quot;: &quot;A String&quot;, # Title of the document.
              &quot;uri&quot;: &quot;A String&quot;, # Uri of the document.
            },
          },
          &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
            &quot;document&quot;: &quot;A String&quot;, # Document resource name.
            &quot;documentContexts&quot;: [ # List of document contexts. The content will be used for Answer Generation. This is supposed to be the main content of the document that can be long and comprehensive.
              { # Document context.
                &quot;content&quot;: &quot;A String&quot;, # Document content to be used for answer generation.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;extractiveAnswers&quot;: [ # Deprecated: This field is deprecated and will have no effect on the Answer generation. Please use document_contexts and extractive_segments fields. List of extractive answers.
              { # Extractive answer. [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
                &quot;content&quot;: &quot;A String&quot;, # Extractive answer content.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;extractiveSegments&quot;: [ # List of extractive segments.
              { # Extractive segment. [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments) Answer generation will only use it if document_contexts is empty. This is supposed to be shorter snippets.
                &quot;content&quot;: &quot;A String&quot;, # Extractive segment content.
                &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              },
            ],
            &quot;title&quot;: &quot;A String&quot;, # Title.
            &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
          },
        },
      ],
    },
  },
  &quot;session&quot;: &quot;A String&quot;, # The session resource name. Not required. When session field is not set, the API is in sessionless mode. We support auto session mode: users can use the wildcard symbol `-` as session ID. A new ID will be automatically generated and assigned.
  &quot;userLabels&quot;: { # The user labels applied to a resource must meet the following requirements: * Each resource can have multiple labels, up to a maximum of 64. * Each label must be a key-value pair. * Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters. * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. * The key portion of a label must be unique. However, you can use the same key with multiple resources. * Keys must start with a lowercase letter or international character. See [Google Cloud Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) for more details.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;userPseudoId&quot;: &quot;A String&quot;, # A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ConversationalSearchService.AnswerQuery method.
  &quot;answer&quot;: { # Defines an answer. # Answer resource object. If AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps is greater than 1, use Answer.name to fetch answer information using ConversationalSearchService.GetAnswer API.
    &quot;answerSkippedReasons&quot;: [ # Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
      &quot;A String&quot;,
    ],
    &quot;answerText&quot;: &quot;A String&quot;, # The textual answer.
    &quot;blobAttachments&quot;: [ # List of blob attachments in the answer.
      { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
        &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
        &quot;data&quot;: { # The media type and data of the blob. # Output only. The mime type and data of the blob.
          &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
          &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated or retrieved data.
        },
      },
    ],
    &quot;citations&quot;: [ # Citations.
      { # Citation info for a segment.
        &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive. Measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
        &quot;sources&quot;: [ # Citation sources for the attributed segment.
          { # Citation source.
            &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
          },
        ],
        &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
      },
    ],
    &quot;completeTime&quot;: &quot;A String&quot;, # Output only. Answer completed timestamp.
    &quot;createTime&quot;: &quot;A String&quot;, # Output only. Answer creation timestamp.
    &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
    &quot;groundingSupports&quot;: [ # Optional. Grounding supports.
      { # Grounding support for a claim in `answer_text`.
        &quot;endIndex&quot;: &quot;A String&quot;, # Required. End of the claim, exclusive.
        &quot;groundingCheckRequired&quot;: True or False, # Indicates that this claim required grounding check. When the system decided this claim didn&#x27;t require attribution/grounding check, this field is set to false. In that case, no grounding check was done for the claim and therefore `grounding_score`, `sources` is not returned.
        &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks.
        &quot;sources&quot;: [ # Optional. Citation sources for the claim.
          { # Citation source.
            &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
          },
        ],
        &quot;startIndex&quot;: &quot;A String&quot;, # Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode).
      },
    ],
    &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*`
    &quot;queryUnderstandingInfo&quot;: { # Query understanding information. # Query understanding information.
      &quot;queryClassificationInfo&quot;: [ # Query classification information.
        { # Query classification information.
          &quot;positive&quot;: True or False, # Classification output.
          &quot;type&quot;: &quot;A String&quot;, # Query classification type.
        },
      ],
    },
    &quot;references&quot;: [ # References.
      { # Reference.
        &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
          &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
            &quot;A String&quot;,
          ],
          &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
          &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
          &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
            &quot;document&quot;: &quot;A String&quot;, # Document resource name.
            &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
            &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;title&quot;: &quot;A String&quot;, # Title.
            &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
          },
          &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
        },
        &quot;structuredDocumentInfo&quot;: { # Structured search information. # Structured document information.
          &quot;document&quot;: &quot;A String&quot;, # Document resource name.
          &quot;structData&quot;: { # Structured search data.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the document.
          &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the document.
        },
        &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
          &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
            { # Chunk content.
              &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                &quot;A String&quot;,
              ],
              &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
              &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
              &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
            },
          ],
          &quot;document&quot;: &quot;A String&quot;, # Document resource name.
          &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;title&quot;: &quot;A String&quot;, # Title.
          &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
        },
      },
    ],
    &quot;relatedQuestions&quot;: [ # Suggested related questions.
      &quot;A String&quot;,
    ],
    &quot;safetyRatings&quot;: [ # Optional. Safety ratings.
      { # Safety rating corresponding to the generated content.
        &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was filtered out because of this rating.
        &quot;category&quot;: &quot;A String&quot;, # Output only. Harm category.
        &quot;probability&quot;: &quot;A String&quot;, # Output only. Harm probability levels in the content.
        &quot;probabilityScore&quot;: 3.14, # Output only. Harm probability score.
        &quot;severity&quot;: &quot;A String&quot;, # Output only. Harm severity levels in the content.
        &quot;severityScore&quot;: 3.14, # Output only. Harm severity score.
      },
    ],
    &quot;state&quot;: &quot;A String&quot;, # The state of the answer generation.
    &quot;steps&quot;: [ # Answer generation steps.
      { # Step information.
        &quot;actions&quot;: [ # Actions.
          { # Action.
            &quot;observation&quot;: { # Observation. # Observation.
              &quot;searchResults&quot;: [ # Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user.
                {
                  &quot;chunkInfo&quot;: [ # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.
                    { # Chunk information.
                      &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                      &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                      &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                    },
                  ],
                  &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                  &quot;snippetInfo&quot;: [ # If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.
                    { # Snippet information.
                      &quot;snippet&quot;: &quot;A String&quot;, # Snippet content.
                      &quot;snippetStatus&quot;: &quot;A String&quot;, # Status of the snippet defined by the search team.
                    },
                  ],
                  &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It&#x27;s populated from the struct data from the Document, or the Chunk in search result.
                    &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                  },
                  &quot;title&quot;: &quot;A String&quot;, # Title.
                  &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                },
              ],
            },
            &quot;searchAction&quot;: { # Search action. # Search action.
              &quot;query&quot;: &quot;A String&quot;, # The query to search.
            },
          },
        ],
        &quot;description&quot;: &quot;A String&quot;, # The description of the step.
        &quot;state&quot;: &quot;A String&quot;, # The state of the step.
        &quot;thought&quot;: &quot;A String&quot;, # The thought of the step.
      },
    ],
  },
  &quot;answerQueryToken&quot;: &quot;A String&quot;, # A global unique ID used for logging.
  &quot;session&quot;: { # External session proto definition. # Session resource object. It will be only available when session field is set and valid in the AnswerQueryRequest request.
    &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the session. This field is used to identify the session in the UI. By default, the display name is the first turn query text in the session.
    &quot;endTime&quot;: &quot;A String&quot;, # Output only. The time the session finished.
    &quot;isPinned&quot;: True or False, # Optional. Whether the session is pinned, pinned session will be displayed on the top of the session list.
    &quot;labels&quot;: [ # Optional. The labels for the session. Can be set as filter in ListSessionsRequest.
      &quot;A String&quot;,
    ],
    &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*`
    &quot;startTime&quot;: &quot;A String&quot;, # Output only. The time the session started.
    &quot;state&quot;: &quot;A String&quot;, # The state of the session.
    &quot;turns&quot;: [ # Turns.
      { # Represents a turn, including a query from the user and a answer from service.
        &quot;answer&quot;: &quot;A String&quot;, # Optional. The resource name of the answer to the user query. Only set if the answer generation (/answer API call) happened in this turn.
        &quot;detailedAnswer&quot;: { # Defines an answer. # Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting answer query session.
          &quot;answerSkippedReasons&quot;: [ # Additional answer-skipped reasons. This provides the reason for ignored cases. If nothing is skipped, this field is not set.
            &quot;A String&quot;,
          ],
          &quot;answerText&quot;: &quot;A String&quot;, # The textual answer.
          &quot;blobAttachments&quot;: [ # List of blob attachments in the answer.
            { # Stores binarydata attached to text answer, e.g. image, video, audio, etc.
              &quot;attributionType&quot;: &quot;A String&quot;, # Output only. The attribution type of the blob.
              &quot;data&quot;: { # The media type and data of the blob. # Output only. The mime type and data of the blob.
                &quot;data&quot;: &quot;A String&quot;, # Output only. Raw bytes.
                &quot;mimeType&quot;: &quot;A String&quot;, # Output only. The media type (MIME type) of the generated or retrieved data.
              },
            },
          ],
          &quot;citations&quot;: [ # Citations.
            { # Citation info for a segment.
              &quot;endIndex&quot;: &quot;A String&quot;, # End of the attributed segment, exclusive. Measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
              &quot;sources&quot;: [ # Citation sources for the attributed segment.
                { # Citation source.
                  &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
                },
              ],
              &quot;startIndex&quot;: &quot;A String&quot;, # Index indicates the start of the segment, measured in bytes (UTF-8 unicode). If there are multi-byte characters,such as non-ASCII characters, the index measurement is longer than the string length.
            },
          ],
          &quot;completeTime&quot;: &quot;A String&quot;, # Output only. Answer completed timestamp.
          &quot;createTime&quot;: &quot;A String&quot;, # Output only. Answer creation timestamp.
          &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded the answer is by the reference chunks.
          &quot;groundingSupports&quot;: [ # Optional. Grounding supports.
            { # Grounding support for a claim in `answer_text`.
              &quot;endIndex&quot;: &quot;A String&quot;, # Required. End of the claim, exclusive.
              &quot;groundingCheckRequired&quot;: True or False, # Indicates that this claim required grounding check. When the system decided this claim didn&#x27;t require attribution/grounding check, this field is set to false. In that case, no grounding check was done for the claim and therefore `grounding_score`, `sources` is not returned.
              &quot;groundingScore&quot;: 3.14, # A score in the range of [0, 1] describing how grounded is a specific claim by the references. Higher value means that the claim is better supported by the reference chunks.
              &quot;sources&quot;: [ # Optional. Citation sources for the claim.
                { # Citation source.
                  &quot;referenceId&quot;: &quot;A String&quot;, # ID of the citation source.
                },
              ],
              &quot;startIndex&quot;: &quot;A String&quot;, # Required. Index indicates the start of the claim, measured in bytes (UTF-8 unicode).
            },
          ],
          &quot;name&quot;: &quot;A String&quot;, # Immutable. Fully qualified name `projects/{project}/locations/global/collections/{collection}/engines/{engine}/sessions/*/answers/*`
          &quot;queryUnderstandingInfo&quot;: { # Query understanding information. # Query understanding information.
            &quot;queryClassificationInfo&quot;: [ # Query classification information.
              { # Query classification information.
                &quot;positive&quot;: True or False, # Classification output.
                &quot;type&quot;: &quot;A String&quot;, # Query classification type.
              },
            ],
          },
          &quot;references&quot;: [ # References.
            { # Reference.
              &quot;chunkInfo&quot;: { # Chunk information. # Chunk information.
                &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                  &quot;A String&quot;,
                ],
                &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
                  &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                  &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                  &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
                    &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                  },
                  &quot;title&quot;: &quot;A String&quot;, # Title.
                  &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                },
                &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
              },
              &quot;structuredDocumentInfo&quot;: { # Structured search information. # Structured document information.
                &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                &quot;structData&quot;: { # Structured search data.
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                },
                &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the document.
                &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the document.
              },
              &quot;unstructuredDocumentInfo&quot;: { # Unstructured document information. # Unstructured document information.
                &quot;chunkContents&quot;: [ # List of cited chunk contents derived from document content.
                  { # Chunk content.
                    &quot;blobAttachmentIndexes&quot;: [ # Output only. Stores indexes of blobattachments linked to this chunk.
                      &quot;A String&quot;,
                    ],
                    &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                    &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                    &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                  },
                ],
                &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                &quot;structData&quot;: { # The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
                  &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                },
                &quot;title&quot;: &quot;A String&quot;, # Title.
                &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
              },
            },
          ],
          &quot;relatedQuestions&quot;: [ # Suggested related questions.
            &quot;A String&quot;,
          ],
          &quot;safetyRatings&quot;: [ # Optional. Safety ratings.
            { # Safety rating corresponding to the generated content.
              &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was filtered out because of this rating.
              &quot;category&quot;: &quot;A String&quot;, # Output only. Harm category.
              &quot;probability&quot;: &quot;A String&quot;, # Output only. Harm probability levels in the content.
              &quot;probabilityScore&quot;: 3.14, # Output only. Harm probability score.
              &quot;severity&quot;: &quot;A String&quot;, # Output only. Harm severity levels in the content.
              &quot;severityScore&quot;: 3.14, # Output only. Harm severity score.
            },
          ],
          &quot;state&quot;: &quot;A String&quot;, # The state of the answer generation.
          &quot;steps&quot;: [ # Answer generation steps.
            { # Step information.
              &quot;actions&quot;: [ # Actions.
                { # Action.
                  &quot;observation&quot;: { # Observation. # Observation.
                    &quot;searchResults&quot;: [ # Search results observed by the search action, it can be snippets info or chunk info, depending on the citation type set by the user.
                      {
                        &quot;chunkInfo&quot;: [ # If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on, populate chunk info.
                          { # Chunk information.
                            &quot;chunk&quot;: &quot;A String&quot;, # Chunk resource name.
                            &quot;content&quot;: &quot;A String&quot;, # Chunk textual content.
                            &quot;relevanceScore&quot;: 3.14, # The relevance of the chunk for a given query. Values range from 0.0 (completely irrelevant) to 1.0 (completely relevant). This value is for informational purpose only. It may change for the same query and chunk at any time due to a model retraining or change in implementation.
                          },
                        ],
                        &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                        &quot;snippetInfo&quot;: [ # If citation_type is DOCUMENT_LEVEL_CITATION, populate document level snippets.
                          { # Snippet information.
                            &quot;snippet&quot;: &quot;A String&quot;, # Snippet content.
                            &quot;snippetStatus&quot;: &quot;A String&quot;, # Status of the snippet defined by the search team.
                          },
                        ],
                        &quot;structData&quot;: { # Data representation. The structured JSON data for the document. It&#x27;s populated from the struct data from the Document, or the Chunk in search result.
                          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
                        },
                        &quot;title&quot;: &quot;A String&quot;, # Title.
                        &quot;uri&quot;: &quot;A String&quot;, # URI for the document.
                      },
                    ],
                  },
                  &quot;searchAction&quot;: { # Search action. # Search action.
                    &quot;query&quot;: &quot;A String&quot;, # The query to search.
                  },
                },
              ],
              &quot;description&quot;: &quot;A String&quot;, # The description of the step.
              &quot;state&quot;: &quot;A String&quot;, # The state of the step.
              &quot;thought&quot;: &quot;A String&quot;, # The thought of the step.
            },
          ],
        },
        &quot;detailedAssistAnswer&quot;: { # AssistAnswer resource, main part of AssistResponse. # Output only. In ConversationalSearchService.GetSession API, if GetSessionRequest.include_answer_details is set to true, this field will be populated when getting assistant session.
          &quot;assistSkippedReasons&quot;: [ # Reasons for not answering the assist call.
            &quot;A String&quot;,
          ],
          &quot;customerPolicyEnforcementResult&quot;: { # Customer policy enforcement results. Contains the results of the various policy checks, like the banned phrases or the Model Armor checks. # Optional. The field contains information about the various policy checks&#x27; results like the banned phrases or the Model Armor checks. This field is populated only if the assist call was skipped due to a policy violation.
            &quot;policyResults&quot;: [ # Customer policy enforcement results. Populated only if the assist call was skipped due to a policy violation. It contains results from those filters that blocked the processing of the query.
              { # Customer policy enforcement result for a single policy type.
                &quot;bannedPhraseEnforcementResult&quot;: { # Customer policy enforcement result for the banned phrase policy. # The policy enforcement result for the banned phrase policy.
                  &quot;bannedPhrases&quot;: [ # The banned phrases that were found in the query or the answer.
                    &quot;A String&quot;,
                  ],
                },
                &quot;modelArmorEnforcementResult&quot;: { # Customer policy enforcement result for the Model Armor policy. # The policy enforcement result for the Model Armor policy.
                  &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error returned by Model Armor if the policy enforcement failed for some reason.
                    &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
                    &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
                      {
                        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
                      },
                    ],
                    &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
                  },
                  &quot;modelArmorViolation&quot;: &quot;A String&quot;, # The Model Armor violation that was found.
                },
              },
            ],
            &quot;verdict&quot;: &quot;A String&quot;, # Final verdict of the customer policy enforcement. If only one policy blocked the processing, the verdict is BLOCK.
          },
          &quot;name&quot;: &quot;A String&quot;, # Immutable. Identifier. Resource name of the `AssistAnswer`. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/sessions/{session}/assistAnswers/{assist_answer}` This field must be a UTF-8 encoded string with a length limit of 1024 characters.
          &quot;replies&quot;: [ # Replies of the assistant.
            { # One part of the multi-part response of the assist call.
              &quot;groundedContent&quot;: { # A piece of content and possibly its grounding information. Not all content needs grounding. Phrases like &quot;Of course, I will gladly search it for you.&quot; do not need grounding. # Possibly grounded response text or media from the assistant.
                &quot;citationMetadata&quot;: { # A collection of source attributions for a piece of content. # Source attribution of the generated content. See also https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview#citation_check
                  &quot;citations&quot;: [ # Output only. List of citations.
                    { # Source attributions for content.
                      &quot;endIndex&quot;: 42, # Output only. End index into the content.
                      &quot;license&quot;: &quot;A String&quot;, # Output only. License of the attribution.
                      &quot;publicationDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. Publication date of the attribution.
                        &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
                        &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
                        &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
                      },
                      &quot;startIndex&quot;: 42, # Output only. Start index into the content.
                      &quot;title&quot;: &quot;A String&quot;, # Output only. Title of the attribution.
                      &quot;uri&quot;: &quot;A String&quot;, # Output only. Url reference of the attribution.
                    },
                  ],
                },
                &quot;content&quot;: { # Multi-modal content. # The content.
                  &quot;codeExecutionResult&quot;: { # Result of executing ExecutableCode. # Result of executing an ExecutableCode.
                    &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
                    &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
                  },
                  &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed by the model. # Code generated by the model that is meant to be executed.
                    &quot;code&quot;: &quot;A String&quot;, # Required. The code content. Currently only supports Python.
                  },
                  &quot;file&quot;: { # A file, e.g., an audio summary. # A file, e.g., an audio summary.
                    &quot;fileId&quot;: &quot;A String&quot;, # Required. The file ID.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The media type (MIME type) of the file.
                  },
                  &quot;inlineData&quot;: { # Inline blob. # Inline binary data.
                    &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The media type (MIME type) of the generated data.
                  },
                  &quot;role&quot;: &quot;A String&quot;, # The producer of the content. Can be &quot;model&quot; or &quot;user&quot;.
                  &quot;text&quot;: &quot;A String&quot;, # Inline text.
                  &quot;thought&quot;: True or False, # Optional. Indicates if the part is thought from the model.
                },
                &quot;textGroundingMetadata&quot;: { # Grounding details for text sources. # Metadata for grounding based on text sources.
                  &quot;references&quot;: [ # References for the grounded text.
                    { # Referenced content and related document metadata.
                      &quot;content&quot;: &quot;A String&quot;, # Referenced text content.
                      &quot;documentMetadata&quot;: { # Document metadata. # Document metadata.
                        &quot;document&quot;: &quot;A String&quot;, # Document resource name.
                        &quot;domain&quot;: &quot;A String&quot;, # Domain name from the document URI. Note that the `uri` field may contain a URL that redirects to the actual website, in which case this will contain the domain name of the target site.
                        &quot;mimeType&quot;: &quot;A String&quot;, # The mime type of the document. https://www.iana.org/assignments/media-types/media-types.xhtml.
                        &quot;pageIdentifier&quot;: &quot;A String&quot;, # Page identifier.
                        &quot;title&quot;: &quot;A String&quot;, # Title.
                        &quot;uri&quot;: &quot;A String&quot;, # URI for the document. It may contain a URL that redirects to the actual website.
                      },
                    },
                  ],
                  &quot;segments&quot;: [ # Grounding information for parts of the text.
                    { # Grounding information for a segment of the text.
                      &quot;endIndex&quot;: &quot;A String&quot;, # End of the segment, exclusive.
                      &quot;groundingScore&quot;: 3.14, # Score for the segment.
                      &quot;referenceIndices&quot;: [ # References for the segment.
                        42,
                      ],
                      &quot;startIndex&quot;: &quot;A String&quot;, # Zero-based index indicating the start of the segment, measured in bytes of a UTF-8 string (i.e. characters encoded on multiple bytes have a length of more than one).
                      &quot;text&quot;: &quot;A String&quot;, # The text segment itself.
                    },
                  ],
                },
              },
              &quot;replyId&quot;: &quot;A String&quot;, # Output only. When set, uniquely identifies a reply within the `AssistAnswer` resource. During an AssistantService.StreamAssist call, multiple `Reply` messages with the same ID can occur within the response stream (across multiple AssistantService.StreamAssistResponse messages). These represent parts of a single `Reply` message in the final `AssistAnswer` resource.
            },
          ],
          &quot;state&quot;: &quot;A String&quot;, # State of the answer generation.
        },
        &quot;query&quot;: { # Defines a user inputed query. # Optional. The user query. May not be set if this turn is merely regenerating an answer to a different turn
          &quot;queryId&quot;: &quot;A String&quot;, # Output only. Unique Id for the query.
          &quot;text&quot;: &quot;A String&quot;, # Plain text.
        },
        &quot;queryConfig&quot;: { # Optional. Represents metadata related to the query config, for example LLM model and version used, model parameters (temperature, grounding parameters, etc.). The prefix &quot;google.&quot; is reserved for Google-developed functionality.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
      },
    ],
    &quot;userPseudoId&quot;: &quot;A String&quot;, # A unique identifier for tracking users.
  },
}</pre>
</div>

</body></html>